Você está perdendo oportunidades de negociação:
- Aplicativos de negociação gratuitos
- 8 000+ sinais para cópia
- Notícias econômicas para análise dos mercados financeiros
Registro
Login
Você concorda com a política do site e com os termos de uso
Se você não tem uma conta, por favor registre-se
Eu verifiquei. Quando um SL/TP é acionado, você tem esta transação :
Quando vou a curto prazo - de uma posição virgem, recebo 3 transações:
Uma entrada )
Uma vez parada a perda desencadeada, eu recebo
B saída )
SemTRADE_TRANSACTION_POSITION. Acho que você não pode usá-lo aqui.
Resumo:
Um resumo é aberto, a primeira transação é
entry-type=IN trans-type=DEAL_ADD order_type=BUYsl=1.3119000 tp=1.3088000
Curto fechado, por parada ou alvo, primeira transação refletida
entry-type=IN trans-type=DEAL_ADD order_type=BUY sl=0.0 tp=0.0
Isto é confuso. Deveria ser:
abreviado:
entry-type=IN trans-type=DEAL_ADD order_type=SELLLsl=1.3119000 tp=1.3088000
fechar curto prazo:
entry-type=OUT trans-type=DEAL_ADD order_type=BUY sl=0.0 tp=0.0
Eu verifiquei. Quando um SL/TP é acionado, você tem esta transação :
Quando vou a curto prazo - de uma posição virgem, recebo 3 transações:
Uma entrada )
Uma vez parada a perda desencadeada, eu recebo
B saída )
SemTRADE_TRANSACTION_POSITION.Acho que você não pode usá-lo aqui.
...Você está perdendo algumas transações, não sabe por quê. Por que voltar a testar?
Pequena digressão, intead de :
você pode usar :
EnumToString(t.order_type)
Pequena digressão, intead de :
você pode usar :
Obrigado por EnumToString. Muito mais inteligente de usar.
Sim, minha preocupação é com a transação no backtest. Mas para torná-la o mais real possível, a transação deve ser a mesma que em comércio ao vivo.
TRADE_TRANSACTION_POSITION não está relacionada a uma transação, como você também mencionou anteriormente. Acho que isso indica, por exemplo, quando você movimentou algum dinheiro em sua conta.
...
A questão parece haver algumas transações que não estão disponíveis quando se faz um backtesting. Um bug ou uma limitação do backtesting. Ao executar um teste de avanço, eu tenho uma OPOSIÇÃO_TRANSACTION_TRANSACTION quando SL/TP é acionado.
2013.05.08 19:20:29 tc_ea_trans (EURUSD,M1) TRADE_TRANSACTION_ORDER_ADD
2013.05.08 19:20:29 tc_ea_trans (EURUSD,M1) trans=symbol=EURUSD price=1.3170100 volume=0.01 sl=0.0000000 tp=0.0000000 order=19683612 deal=0 entry-type=IN trans-type=ORDER_ADD order_type=BUY deal_type=DEAL_TYPE_BUY type_time=0 expiration=1970.01.01 00:00 price_trigger=0.0000000 profit=0.00
2013.05.08 19:20:29 tc_ea_trans (EURUSD,M1) TRADE_TRANSACTION_ORDER_DELETE
2013.05.08 19:20:29 tc_ea_trans (EURUSD,M1) trans=symbol=EURUSD price=1.3170100 volume=0.01 sl=0.0000000 tp=0.0000000 order=19683612 deal=0 entry-type=IN trans-type=ORDER_DELETE order_type=BUY deal_type=DEAL_TYPE_BUY type_time=0 expiration=1970.01.01 00:00 price_trigger=0.0000000 profit=0.00
2013.05.08 19:20:29 tc_ea_trans (EURUSD,M1) TRADE_TRANSACTION_HISTORY_ADD
2013.05.08 19:20:29 tc_ea_trans (EURUSD,M1) trans=symbol=EURUSD price=1.3170100 volume=0.00 sl=0.0000000 tp=0.0000000 order=19683612 deal=0 entry-type=IN trans-type=HISTORY_ADD order_type=BUY deal_type=DEAL_TYPE_BUY type_time=0 expiration=1970.01.01 00:00 price_trigger=0.0000000 profit=0.00
2013.05.08 19:20:29 tc_ea_trans (EURUSD,M1) TRADE_TRANSACTION_POSITION
2013.05.08 19:20:29 tc_ea_trans (EURUSD,M1) trans=symbol=EURUSD price=1.3173500 volume=0.01 sl=1.3174200 tp=1.3170100 order=0 deal=0 entry-type=IN trans-type=POSITION order_type=BUY deal_type=DEAL_TYPE_SELL type_time=0 expiration=1970.01.01 00:00 price_trigger=0.0000000 profit=0.00
2013.05.08 19:20:29 tc_ea_trans (EURUSD,M1) TRADE_TRANSACTION_DEAL_ADD
2013.05.08 19:20:29 tc_ea_trans (EURUSD,M1) trans=symbol=EURUSD price=1.3170100 volume=0.01 sl=0.0000000 tp=0.0000000 order=19683612 deal=16655372 entry-type=OUT trans-type=DEAL_ADD order_type=BUY deal_type=DEAL_TYPE_BUY type_time=0 expiration=1970.01.01 00:00 price_trigger=0.0000000 profit=0.34
A questão parece haver algumas transações que não estão disponíveis quando se faz um backtesting. Um bug ou uma limitação do backtesting. Ao executar um teste de avanço, eu tenho uma OPOSIÇÃO_TRANSACTION_TRANSACTION quando SL/TP é acionado.
2013.05.08 19:20:29 tc_ea_trans (EURUSD,M1) TRADE_TRANSACTION_ORDER_ADD
2013.05.08 19:20:29 tc_ea_trans (EURUSD,M1) trans=symbol=EURUSD price=1.3170100 volume=0.01 sl=0.0000000 tp=0.0000000 order=19683612 deal=0 entry-type=IN trans-type=ORDER_ADD order_type=BUY deal_type=DEAL_TYPE_BUY type_time=0 expiration=1970.01.01 00:00 price_trigger=0.0000000 profit=0.00
2013.05.08 19:20:29 tc_ea_trans (EURUSD,M1) TRADE_TRANSACTION_ORDER_DELETE
2013.05.08 19:20:29 tc_ea_trans (EURUSD,M1) trans=symbol=EURUSD price=1.3170100 volume=0.01 sl=0.0000000 tp=0.0000000 order=19683612 deal=0 entry-type=IN trans-type=ORDER_DELETE order_type=BUY deal_type=DEAL_TYPE_BUY type_time=0 expiration=1970.01.01 00:00 price_trigger=0.0000000 profit=0.00
2013.05.08 19:20:29 tc_ea_trans (EURUSD,M1) TRADE_TRANSACTION_HISTORY_ADD
2013.05.08 19:20:29 tc_ea_trans (EURUSD,M1) trans=symbol=EURUSD price=1.3170100 volume=0.00 sl=0.0000000 tp=0.0000000 order=19683612 deal=0 entry-type=IN trans-type=HISTORY_ADD order_type=BUY deal_type=DEAL_TYPE_BUY type_time=0 expiration=1970.01.01 00:00 price_trigger=0.0000000 profit=0.00
2013.05.08 19:20:29 tc_ea_trans (EURUSD,M1) TRADE_TRANSACTION_POSITION
2013.05.08 19:20:29 tc_ea_trans (EURUSD,M1) trans=symbol=EURUSD price=1.3173500 volume=0.01 sl=1.3174200 tp=1.3170100 order=0 deal=0 entry-type=IN trans-type=POSITION order_type=BUY deal_type=DEAL_TYPE_SELL type_time=0 expiration=1970.01.01 00:00 price_trigger=0.0000000 profit=0.00
2013.05.08 19:20:29 tc_ea_trans (EURUSD,M1) TRADE_TRANSACTION_DEAL_ADD
2013.05.08 19:20:29 tc_ea_trans (EURUSD,M1) trans=symbol=EURUSD price=1.3170100 volume=0.01 sl=0.0000000 tp=0.0000000 order=19683612 deal=16655372 entry-type=OUT trans-type=DEAL_ADD order_type=BUY deal_type=DEAL_TYPE_BUY type_time=0 expiration=1970.01.01 00:00 price_trigger=0.0000000 profit=0.34
Olá angevoyageur,
ainda têm o problema de ter o preço executado de uma parada ou perda ligado a uma posiçao - em backktest. Não sei até agora, como se comporta em condições de vida.
Isto é do log backtest:
Como você pode ver na última linha, o preço executado é dado no log -> [#7 comprar 0,01 EURUSD a 1,27349].
Mas nenhuma estrutura, transação, negócio ou histórico de pedidos fornece este preço.
Esta linha descarta a transação relacionada à parada acionada:
Este é o código da função de despejo:
Então tentei obter o preço de execução do histórico de pedidos e negócios: nenhum resultado
Olá angevoyageur,
...Obrigado, irei estudar isso o mais rápido possível.
Isto é muito bom. Não tenha pressa.
Verifiquei cada transação, solicitação e resultado passados para a OnTradeTransaction.
O preço de parada de perda acionado mencionado no log backktest (criado por MetaTrader) não pode ser encontrado exceto como preço sl, mas não como preço ou preço de negociação ou preço de execução.
Isto é muito bom. Não tenha pressa.
Verifiquei cada transação, solicitação e resultado passados para a OnTradeTransaction.
O preço de parada de perda acionado mencionado no log backktest (criado por MetaTrader) não pode ser encontrado exceto como preço sl, mas não como preço ou preço de negociação ou preço de execução.
Portanto, estamos falando apenas de testes de retaguarda. Eu testei com meu próprio código e obtenho 3 transações quando uma parada é acionada:
2013.05.15 10:22:27 Core 1 2013.05.10 16:20:37 Symbol : EURUSD event : TRADE_TRANSACTION_DEAL_ADD(6)
2013.05.15 10:22:27 Core 1 2013.05.10 16:20:37 Symbol : EURUSD event : TRADE_TRANSACTION_ORDER_DELETE(2)
2013.05.15 10:22:27 Core 1 2013.05.10 16:20:37 Symbol : EURUSD event : TRADE_TRANSACTION_HISTORY_ADD(3)