OnTradeTransaction 백테스트에서 중지 트리거 감지 - 페이지 3 12345 새 코멘트 chinaski 2013.05.08 15:06 #21 angevoyageur : 나는 확인했다. SL/TP가 트리거되면 다음과 같은 트랜잭션이 발생합니다. SL 및 TP가 설정된 TRADE_TRANSACTION_POSITION(그러나 아직 거래 없음), TRADE_TRANSACTION_DEAL_ADD 매도할 때 - 처녀 위치에서 3개의 거래를 얻습니다. 항목) 20130507 21 : 52 : 28 : 943 entry short at 1.31060 time= 2013.01 . 10 11 : 43 20130507 21 : 52 : 28 : 943 symbol=EURUSD price= 1.3106000 volume= 0.01 sl= 1.3119000 tp= 1.3088000 order= 2 deal= 2 entry-type=IN trans-type=DEAL_ADD order_type=BUY deal_type= DEAL_TYPE_SELL type_time= 0 expiration= 1970.01 . 01 00 : 00 price_trigger= 0.0000000 profit= 0.00 20130507 21 : 52 : 28 : 943 symbol=EURUSD price= 1.3106000 volume= 0.01 sl= 1.3119000 tp= 1.3088000 order= 2 deal= 0 entry-type=IN trans-type=ORDER_DELETE order_type=SELL deal_type= DEAL_TYPE_BUY type_time= 0 expiration= 1970.01 . 01 00 : 00 price_trigger= 0.0000000 profit= 0.00 20130507 21 : 52 : 28 : 943 symbol=EURUSD price= 1.3106000 volume= 0.00 sl= 1.3119000 tp= 1.3088000 order= 2 deal= 0 entry-type=IN trans-type=HISTORY_ADD order_type=SELL deal_type= DEAL_TYPE_BUY type_time= 0 expiration= 1970.01 . 01 00 : 00 price_trigger= 0.0000000 profit= 0.00 손절매 가 발동되면 B 출구) 20130507 21 : 52 : 28 : 945 symbol=EURUSD price= 1.3119000 volume= 0.01 sl= 0.0000000 tp= 0.0000000 order= 3 deal= 3 entry-type=IN 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.00 TRADE_TRANSACTION_POSITION이(가) 없습니다. 여기서 사용하시면 안될 것 같아요. 요약: 매도가 열리면 첫 번째 거래는 항목 유형=IN 트랜스 유형=DEAL_ADD order_type=BUY sl= 1.3119000 tp= 1.3088000 스톱 또는 타겟에 의한 매도 마감, 첫 번째 반영된 거래 항목 유형=IN 트랜스 유형=DEAL_ADD order_type=BUY sl=0.0 tp=0.0 이것은 혼란스럽습니다. 그것은해야한다: 짧은 열기: 항목 유형=IN 트랜스 유형=DEAL_ADD order_type=SELL sl= 1.3119000 tp= 1.3088000 짧게 닫기: entry-type=OUT trans-type=DEAL_ADD order_type=BUY sl=0.0 tp=0.0 항해사 : 나는 확인했다. SL/TP가 트리거되면 다음과 같은 트랜잭션이 발생합니다. SL 및 TP가 설정된 TRADE_TRANSACTION_POSITION(그러나 아직 거래 없음), TRADE_TRANSACTION_DEAL_ADD Detect stop trigger in 배수되지 않도록 마틴을 요리하는 초보자의 질문 MQL4 MT4 Alain Verleyen 2013.05.08 16:01 #22 chinaski : 매도할 때 - 처녀 위치에서 3개의 거래를 얻습니다. 항목) 손절매 가 발동되면 B 출구) TRADE_TRANSACTION_POSITION이(가) 없습니다 . 나는 당신이 여기를 사용할 수 없다고 생각합니다 . ... 일부 거래가 누락되었습니다. 이유를 모르겠습니다. 백테스팅 때문에? Alain Verleyen 2013.05.08 16:07 #23 다음 대신 약간의 이탈: ORDER_TYPE_to_string(t.order_type) 당신이 사용할 수있는 : EnumToString (t.order_type) chinaski 2013.05.08 16:20 #24 angevoyageur : 다음 대신 약간의 이탈: 당신이 사용할 수있는 : EnumToString에 감사드립니다. 훨씬 더 스마트하게 사용할 수 있습니다. 예, 제 관심사는 backtest 의 거래에 관한 것입니다. 그러나 최대한 현실감 있게 하려면 거래가 라이브 거래와 같아야 합니다. TRADE_TRANSACTION_POSITION은(는) 이전에도 언급했듯이 거래와 관련이 없습니다. 예를 들어 귀하가 귀하의 계정에서 돈을 옮겼을 때를 나타내는 것 같습니다. Alain Verleyen 2013.05.08 17:32 #25 chinaski : ... 문제는 백테스팅할 때 사용할 수 없는 일부 트랜잭션이 있는 것 같습니다. 백 테스팅 의 버그 또는 제한 사항. 순방향 테스트에서 실행할 때 SL/TP가 트리거될 때 TRADE_TRANSACTION_POSITION이 있습니다. 2013.05.08 19:20:29 tc_ea_trans (EURUSD,M1) TRADE_TRANSACTION_ORDER_ADD2013.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.002013.05.08 19:20:29 tc_ea_trans (EURUSD,M1) TRADE_TRANSACTION_ORDER_DELETE2013.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.002013.05.08 19:20:29 tc_ea_trans (EURUSD,M1) TRADE_TRANSACTION_HISTORY_ADD2013.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.002013.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.002013.05.08 19:20:29 tc_ea_trans (EURUSD,M1) TRADE_TRANSACTION_DEAL_ADD2013.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 Get in touch with developers using Service Desk! www.mql5.com We therefore attach great importance to all user reports about issues in our programs and try to answer each one of them. Detect stop trigger in OnTradeTransaction processing MetaEditor build 1490 chinaski 2013.05.08 22:22 #26 angevoyageur : 문제는 백테스팅할 때 사용할 수 없는 일부 트랜잭션이 있는 것 같습니다. 백테스팅 의 버그 또는 한계. 순방향 테스트에서 실행할 때 SL/TP가 트리거될 때 TRADE_TRANSACTION_POSITION이 있습니다. 2013.05.08 19:20:29 tc_ea_trans (EURUSD,M1) TRADE_TRANSACTION_ORDER_ADD2013.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.002013.05.08 19:20:29 tc_ea_trans (EURUSD,M1) TRADE_TRANSACTION_ORDER_DELETE2013.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.002013.05.08 19:20:29 tc_ea_trans (EURUSD,M1) TRADE_TRANSACTION_HISTORY_ADD2013.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.002013.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.002013.05.08 19:20:29 tc_ea_trans (EURUSD,M1) TRADE_TRANSACTION_DEAL_ADD2013.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 알겠습니다. 정보 감사합니다. 그래서 나는 이것을 내 고려 사항에 포함시키는 것을 알고 있습니다. chinaski 2013.05.14 21:23 #27 안녕하세요 항해사님. 포지션 인 백테스트 에 첨부된 스탑 또는 손실의 실행 가격을 얻는 데 여전히 문제가 있습니다. 라이브 조건에서 어떻게 행동하는지 지금까지는 모릅니다. 이것은 백테스트 로그에서 가져온 것입니다. KP 0 23 : 18 : 29 Core 1 2010.05 . 11 11 : 00 : 00 instant buy 0.01 EURUSD at 1.26882 ( 1.26871 / 1.26882 / 1.26871 ) EM 0 23 : 18 : 29 Core 1 2010.05 . 11 11 : 00 : 00 deal # 2 buy 0.01 EURUSD at 1.26882 done (based on order # 2 ) MG 0 23 : 18 : 29 Core 1 2010.05 . 11 11 : 00 : 00 deal performed [ # 2 buy 0.01 EURUSD at 1.26882 ] RI 0 23 : 18 : 29 Core 1 2010.05 . 11 11 : 00 : 00 order performed buy 0.01 at 1.26882 [ # 2 buy 0.01 EURUSD at 1.26882 ] JS 0 23 : 18 : 29 Core 1 2010.05 . 11 11 : 00 : 00 CTrade:: OrderSend : instant buy 0.01 EURUSD at 1.26882 [done at 1.26882 ] LP 0 23 : 18 : 29 Core 1 2010.05 . 11 11 : 00 : 00 position modified [buy 0.01 EURUSD 1.26882 sl: 1.26809 tp: 1.27028 ] LM 0 23 : 18 : 29 Core 1 2010.05 . 11 11 : 00 : 00 CTrade:: OrderSend : modify EURUSD (sl: 1.26809 , tp: 1.27028 ) [done] LR 0 23 : 18 : 29 Core 1 2010.05 . 11 11 : 00 : 00 trans=symbol=EURUSD price= 1.2688200 volume= 0.01 sl= 0.0000000 tp= 0.0000000 order= 2 deal= 2 entry-type=IN 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.00 order-open= 0.000000 order-current= 0.000000 deal-price= 0.000000 GG 0 23 : 18 : 29 Core 1 2010.05 . 11 11 : 18 : 40 take profit triggered buy 0.01 EURUSD 1.26882 sl: 1.26809 tp: 1.27028 [ # 3 sell 0.01 EURUSD at 1.27028 ] MD 0 23 : 18 : 29 Core 1 2010.05 . 11 11 : 18 : 40 deal # 3 sell 0.01 EURUSD at 1.27028 done (based on order # 3 ) PI 0 23 : 18 : 29 Core 1 2010.05 . 11 11 : 18 : 40 deal performed [ # 3 sell 0.01 EURUSD at 1.27028 ] NO 0 23 : 18 : 29 Core 1 2010.05 . 11 11 : 18 : 40 order performed sell 0.01 at 1.27028 [ # 3 sell 0.01 EURUSD at 1.27028 ] RS 0 23 : 18 : 29 Core 1 2010.05 . 11 11 : 18 : 40 trans=symbol=EURUSD price= 1.2702800 volume= 0.01 sl= 0.0000000 tp= 0.0000000 order= 3 deal= 3 entry-type=IN trans-type=DEAL_ADD order_type=BUY deal_type= DEAL_TYPE_SELL type_time= 0 expiration= 1970.01 . 01 00 : 00 price_trigger= 0.0000000 profit= 0.00 order-open= 0.000000 order-current= 0.000000 deal-price= 0.000000 JM 0 23 : 18 : 29 Core 1 2010.05 . 20 09 : 00 : 00 ut = 3.00 candle=o= 1.24130 c= 1.24170 h= 1.24360 l= 1.24100 b= 39 uw= 190 lw= 29 FK 0 23 : 18 : 29 Core 1 2010.05 . 20 09 : 00 : 00 instant sell 0.01 EURUSD at 1.24180 ( 1.24180 / 1.24195 / 1.24180 ) MG 0 23 : 18 : 29 Core 1 2010.05 . 20 09 : 00 : 00 deal # 4 sell 0.01 EURUSD at 1.24180 done (based on order # 4 ) IG 0 23 : 18 : 29 Core 1 2010.05 . 20 09 : 00 : 00 deal performed [ # 4 sell 0.01 EURUSD at 1.24180 ] CN 0 23 : 18 : 29 Core 1 2010.05 . 20 09 : 00 : 00 order performed sell 0.01 at 1.24180 [ # 4 sell 0.01 EURUSD at 1.24180 ] EO 0 23 : 18 : 29 Core 1 2010.05 . 20 09 : 00 : 00 CTrade:: OrderSend : instant sell 0.01 EURUSD at 1.24180 [done at 1.24180 ] EQ 0 23 : 18 : 29 Core 1 2010.05 . 20 09 : 00 : 00 position modified [sell 0.01 EURUSD 1.24180 sl: 1.24253 tp: 1.24034 ] DO 0 23 : 18 : 29 Core 1 2010.05 . 20 09 : 00 : 00 CTrade:: OrderSend : modify EURUSD (sl: 1.24253 , tp: 1.24034 ) [done] HI 0 23 : 18 : 29 Core 1 2010.05 . 20 09 : 00 : 00 trans=symbol=EURUSD price= 1.2418000 volume= 0.01 sl= 0.0000000 tp= 0.0000000 order= 4 deal= 4 entry-type=IN trans-type=DEAL_ADD order_type=BUY deal_type= DEAL_TYPE_SELL type_time= 0 expiration= 1970.01 . 01 00 : 00 price_trigger= 0.0000000 profit= 0.00 order-open= 0.000000 order-current= 0.000000 deal-price= 0.000000 JH 0 23 : 18 : 29 Core 1 2010.05 . 20 09 : 00 : 40 stop loss triggered sell 0.01 EURUSD 1.24180 sl: 1.24253 tp: 1.24034 [ # 5 buy 0.01 EURUSD at 1.24253 ] HI 0 23 : 18 : 29 Core 1 2010.05 . 20 09 : 00 : 40 deal # 5 buy 0.01 EURUSD at 1.24253 done (based on order # 5 ) MK 0 23 : 18 : 29 Core 1 2010.05 . 20 09 : 00 : 40 deal performed [ # 5 buy 0.01 EURUSD at 1.24253 ] NL 0 23 : 18 : 29 Core 1 2010.05 . 20 09 : 00 : 40 order performed buy 0.01 at 1.24253 [ # 5 buy 0.01 EURUSD at 1.24253 ] KQ 0 23 : 18 : 29 Core 1 2010.05 . 20 09 : 00 : 40 trans=symbol=EURUSD price= 1.2425300 volume= 0.01 sl= 0.0000000 tp= 0.0000000 order= 5 deal= 5 entry-type=IN 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.00 order-open= 0.000000 order-current= 0.000000 deal-price= 0.000000 PJ 0 23 : 18 : 30 Core 1 2010.08 . 26 09 : 08 : 00 ut = 3.83 candle=o= 1.27238 c= 1.27274 h= 1.27448 l= 1.27238 b= 35 uw= 174 lw= 0 IH 0 23 : 18 : 30 Core 1 2010.08 . 26 09 : 08 : 00 instant sell 0.01 EURUSD at 1.27276 ( 1.27276 / 1.27287 / 1.27276 ) GH 0 23 : 18 : 30 Core 1 2010.08 . 26 09 : 08 : 00 deal # 6 sell 0.01 EURUSD at 1.27276 done (based on order # 6 ) MR 0 23 : 18 : 30 Core 1 2010.08 . 26 09 : 08 : 00 deal performed [ # 6 sell 0.01 EURUSD at 1.27276 ] HR 0 23 : 18 : 30 Core 1 2010.08 . 26 09 : 08 : 00 order performed sell 0.01 at 1.27276 [ # 6 sell 0.01 EURUSD at 1.27276 ] PR 0 23 : 18 : 30 Core 1 2010.08 . 26 09 : 08 : 00 CTrade:: OrderSend : instant sell 0.01 EURUSD at 1.27276 [done at 1.27276 ] FE 0 23 : 18 : 30 Core 1 2010.08 . 26 09 : 08 : 00 position modified [sell 0.01 EURUSD 1.27276 sl: 1.27349 tp: 1.27130 ] LK 0 23 : 18 : 30 Core 1 2010.08 . 26 09 : 08 : 00 CTrade:: OrderSend : modify EURUSD (sl: 1.27349 , tp: 1.27130 ) [done] NE 0 23 : 18 : 30 Core 1 2010.08 . 26 09 : 08 : 00 trans=symbol=EURUSD price= 1.2727600 volume= 0.01 sl= 0.0000000 tp= 0.0000000 order= 6 deal= 6 entry-type=IN trans-type=DEAL_ADD order_type=BUY deal_type= DEAL_TYPE_SELL type_time= 0 expiration= 1970.01 . 01 00 : 00 price_trigger= 0.0000000 profit= 0.00 order-open= 0.000000 order-current= 0.000000 deal-price= 0.000000 HM 0 23 : 18 : 30 Core 1 2010.08 . 26 09 : 08 : 40 stop loss triggered sell 0.01 EURUSD 1.27276 sl: 1.27349 tp: 1.27130 [ # 7 buy 0.01 EURUSD at 1.27349 ] 마지막 줄에서 볼 수 있듯이 실행된 가격은 로그에 나와 있습니다. -> [#7 buy 0.01 EURUSD at 1.27349] 그러나 구조, 거래, 거래 또는 주문 내역이 이 가격을 제공하지 않습니다.이 줄은 트리거된 중지와 관련된 트랜잭션을 덤프합니다. NE 0 23 : 18 : 30 Core 1 2010.08 . 26 09 : 08 : 00 trans=symbol=EURUSD price= 1.2727600 volume= 0.01 sl= 0.0000000 tp= 0.0000000 order= 6 deal= 6 entry-type=IN trans-type=DEAL_ADD order_type=BUY deal_type= DEAL_TYPE_SELL type_time= 0 expiration= 1970.01 . 01 00 : 00 price_trigger= 0.0000000 profit= 0.00 order-open= 0.000000 order-current= 0.000000 deal-price= 0.000000 다음은 덤프 기능 코드입니다. string dump_MqlTradeTransaction( const MqlTradeTransaction & t) { //CDealInfo deal; //deal.Ticket(t.deal); if (t.deal > 0 ) HistoryDealSelect (t.deal); string msg= StringFormat ( "symbol=%s price=%.7f volume=%.2f sl=%.7f tp=%.7f order=%d deal=%d entry-type=%s trans-type=%s order_type=%s deal_type=%s type_time=%d expiration=%s price_trigger=%.7f profit=%.2f order-open=%.6f order-current=%.6f deal-price=%.6f" ,t.symbol ,t.price ,t.volume ,t.price_sl ,t.price_tp ,t.order ,t.deal ,tc_DEAL_ENTRY_to_string_short(( ENUM_DEAL_ENTRY ) HistoryDealGetInteger (t.deal, DEAL_ENTRY )) ,tc_ENUM_TRADE_TRANSACTION_TYPE_to_string_short(( ENUM_TRADE_TRANSACTION_TYPE ) t.type) ,tc_ORDER_TYPE_to_string(t.order_type) ,tc_DEAL_TYPE_to_string(t.deal_type) ,t.time_type , TimeToString (t.time_expiration) ,t.price_trigger ,HistoryDealGetDouble(t.deal, DEAL_PROFIT ) ,HistoryOrderGetDouble(t.order, ORDER_PRICE_OPEN ) ,HistoryOrderGetDouble(t.order, ORDER_PRICE_CURRENT ) ,HistoryDealGetDouble(t.deal, DEAL_PRICE ) ); return msg; } 그래서 주문 및 거래 내역에서 실행 가격을 얻으려고 했습니다. 결과가 없습니다. Alain Verleyen 2013.05.14 21:38 #28 chinaski : 안녕하세요 항해사님. ... 감사합니다. 최대한 빨리 공부하러 가겠습니다. chinaski 2013.05.14 22:23 #29 angevoyageur : 감사합니다. 최대한 빨리 공부하러 가겠습니다. 정말 멋지네요. 서두르지 마. OnTradeTransaction에 전달된 각 거래, 요청 및 결과를 확인했습니다. 백테스트 로그(MetaTrader에서 생성)에 언급된 트리거된 손절매 가격은 sl 가격 외에는 찾을 수 없지만 가격이나 거래 가격 또는 실행 가격으로는 찾을 수 없습니다. Documentation on MQL5: Standard Constants, Enumerations and Structures / Trade Constants / Deal Properties www.mql5.com Standard Constants, Enumerations and Structures / Trade Constants / Deal Properties - Documentation on MQL5 Alain Verleyen 2013.05.15 08:43 #30 chinaski : 정말 멋지네요. 서두르지 마. OnTradeTransaction에 전달된 각 거래, 요청 및 결과를 확인했습니다. 백테스트 로그(MetaTrader에서 생성)에 언급된 트리거된 손절매 가격은 sl 가격 외에는 찾을 수 없지만 가격이나 거래 가격 또는 실행 가격으로는 찾을 수 없습니다. 그래서 우리는 백 테스팅에 대해서만 이야기하고 있습니다. 내 자신의 코드로 테스트했으며 중지가 트리거될 때 3개의 트랜잭션을 얻습니다. 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) DEAL_ADD를 사용하면 거래 가격을 알 수 있으므로 제 경우에는 SL입니다. 모든 것이 나에게 맞는 것 같습니다. 사용하는 코드, 백테스트 로그(파일로) 및 전략 테스터 설정 스크린샷을 보내주시기 바랍니다. 그러면 귀하와 똑같은 테스트를 재현하고 결과를 분석할 수 있습니다. 원하는 경우 저에게 PM을 보낼 수 있습니다. Detect stop trigger in PREDICT time period 정적 배열? 12345 새 코멘트 트레이딩 기회를 놓치고 있어요: 무료 트레이딩 앱 복사용 8,000 이상의 시그널 금융 시장 개척을 위한 경제 뉴스 등록 로그인 공백없는 라틴 문자 비밀번호가 이 이메일로 전송될 것입니다 오류 발생됨 Google으로 로그인 웹사이트 정책 및 이용약관에 동의합니다. 계정이 없으시면, 가입하십시오 MQL5.com 웹사이트에 로그인을 하기 위해 쿠키를 허용하십시오. 브라우저에서 필요한 설정을 활성화하시지 않으면, 로그인할 수 없습니다. 사용자명/비밀번호를 잊으셨습니까? Google으로 로그인
나는 확인했다. SL/TP가 트리거되면 다음과 같은 트랜잭션이 발생합니다.
매도할 때 - 처녀 위치에서 3개의 거래를 얻습니다.
항목)
손절매 가 발동되면
B 출구)
TRADE_TRANSACTION_POSITION이(가) 없습니다. 여기서 사용하시면 안될 것 같아요.
요약:
매도가 열리면 첫 번째 거래는
항목 유형=IN 트랜스 유형=DEAL_ADD order_type=BUY sl= 1.3119000 tp= 1.3088000
스톱 또는 타겟에 의한 매도 마감, 첫 번째 반영된 거래
항목 유형=IN 트랜스 유형=DEAL_ADD order_type=BUY sl=0.0 tp=0.0
이것은 혼란스럽습니다. 그것은해야한다:
짧은 열기:
항목 유형=IN 트랜스 유형=DEAL_ADD order_type=SELL sl= 1.3119000 tp= 1.3088000
짧게 닫기:
entry-type=OUT trans-type=DEAL_ADD order_type=BUY sl=0.0 tp=0.0
나는 확인했다. SL/TP가 트리거되면 다음과 같은 트랜잭션이 발생합니다.
매도할 때 - 처녀 위치에서 3개의 거래를 얻습니다.
항목)
손절매 가 발동되면
B 출구)
TRADE_TRANSACTION_POSITION이(가) 없습니다 . 나는 당신이 여기를 사용할 수 없다고 생각합니다 .
...일부 거래가 누락되었습니다. 이유를 모르겠습니다. 백테스팅 때문에?
다음 대신 약간의 이탈:
당신이 사용할 수있는 :
EnumToString (t.order_type)
다음 대신 약간의 이탈:
당신이 사용할 수있는 :
EnumToString에 감사드립니다. 훨씬 더 스마트하게 사용할 수 있습니다.
예, 제 관심사는 backtest 의 거래에 관한 것입니다. 그러나 최대한 현실감 있게 하려면 거래가 라이브 거래와 같아야 합니다.
TRADE_TRANSACTION_POSITION은(는) 이전에도 언급했듯이 거래와 관련이 없습니다. 예를 들어 귀하가 귀하의 계정에서 돈을 옮겼을 때를 나타내는 것 같습니다.
...
문제는 백테스팅할 때 사용할 수 없는 일부 트랜잭션이 있는 것 같습니다. 백 테스팅 의 버그 또는 제한 사항. 순방향 테스트에서 실행할 때 SL/TP가 트리거될 때 TRADE_TRANSACTION_POSITION이 있습니다.
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
문제는 백테스팅할 때 사용할 수 없는 일부 트랜잭션이 있는 것 같습니다. 백테스팅 의 버그 또는 한계. 순방향 테스트에서 실행할 때 SL/TP가 트리거될 때 TRADE_TRANSACTION_POSITION이 있습니다.
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
안녕하세요 항해사님.
포지션 인 백테스트 에 첨부된 스탑 또는 손실의 실행 가격을 얻는 데 여전히 문제가 있습니다. 라이브 조건에서 어떻게 행동하는지 지금까지는 모릅니다.
이것은 백테스트 로그에서 가져온 것입니다.
마지막 줄에서 볼 수 있듯이 실행된 가격은 로그에 나와 있습니다. -> [#7 buy 0.01 EURUSD at 1.27349]
그러나 구조, 거래, 거래 또는 주문 내역이 이 가격을 제공하지 않습니다.
이 줄은 트리거된 중지와 관련된 트랜잭션을 덤프합니다.
다음은 덤프 기능 코드입니다.
그래서 주문 및 거래 내역에서 실행 가격을 얻으려고 했습니다. 결과가 없습니다.
안녕하세요 항해사님.
...감사합니다. 최대한 빨리 공부하러 가겠습니다.
정말 멋지네요. 서두르지 마.
OnTradeTransaction에 전달된 각 거래, 요청 및 결과를 확인했습니다.
백테스트 로그(MetaTrader에서 생성)에 언급된 트리거된 손절매 가격은 sl 가격 외에는 찾을 수 없지만 가격이나 거래 가격 또는 실행 가격으로는 찾을 수 없습니다.
정말 멋지네요. 서두르지 마.
OnTradeTransaction에 전달된 각 거래, 요청 및 결과를 확인했습니다.
백테스트 로그(MetaTrader에서 생성)에 언급된 트리거된 손절매 가격은 sl 가격 외에는 찾을 수 없지만 가격이나 거래 가격 또는 실행 가격으로는 찾을 수 없습니다.
그래서 우리는 백 테스팅에 대해서만 이야기하고 있습니다. 내 자신의 코드로 테스트했으며 중지가 트리거될 때 3개의 트랜잭션을 얻습니다.
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)