Yes, you will find that in debugging or during back-tests, that "TRADE_TRANSACTION_ORDER_ADD" (and a few others) is often not tracked. However, when in "Live" execution, it is called.
This is probably a bug in the Strategy Tester, but I can't confirm this, and I suspect that MetaQuotes will probably not address it or place it at very low priority.
Yes, you will find that in debugging or during back-tests, that "TRADE_TRANSACTION_ORDER_ADD" (and a few others) is often not tracked. However, when in "Live" execution, it is called.
This is probably a bug in the Strategy Tester, but I can't confirm this, and I suspect that MetaQuotes will probably not address it or place it at very low priority.
Thanks.
It is difficult debugging an EA using the Strategy Tester if there is a significant difference in how they perform.
This should be fixed. It is important that MetaQuotes and the Strategy Tester should show the same behavior so that the testing results are reliable and can be trusted.
Can you answer the following questions in reference to debugging using the Strategy Tester:
What conditions would cause the event OnTradeTransaction with trans.type = TRADE_TRANSACTION_ORDER_ADD?
How can I detect the event TRADE_TRANSACTION_ORDER_ADD when a new Order is added?
Thanks.
It is difficult debugging an EA using the Strategy Tester if there is a significant difference in how they perform.
This should be fixed.
Can you answer the following questions in reference to debugging using the Strategy Tester:
What conditions would cause the event OnTradeTransaction with trans.type = TRADE_TRANSACTION_ORDER_ADD?
How can I detect the event TRADE_TRANSACTION_ORDER_ADD when a new Order is added?
I've never had a problem with the standard OrdersTotal() function in a loop in the Tester.
I figure... If OOP fails, try going standard.
What conditions would cause the event OnTradeTransaction with trans.type = TRADE_TRANSACTION_ORDER_ADD?
How can I detect the event TRADE_TRANSACTION_ORDER_ADD when a new Order is added?
Unknown! I found that it failed 100% of the times I have tested it in the Strategy Tester, but there may be conditions unknown to me where it will work correctly. Instead, when I need to test such functionality, I do so "live" on a demo account.
However, I seldom use or rely on only the OnTradeTransaction() for tracking trades. I use it only as a secondary measure, and instead track the History, Orders and Positions directly, whenever a OnTrade() event occurs, or when a tick value change indicates possible changes in trade state.
- www.mql5.com
I've never had a problem with the standard OrdersTotal() function in a loop in the Tester.
I figure... If OOP fails, try going standard.
In my EA, I am not executing the standard OrdersTotal() function in a loop in the Tester.
I do call OrdersTotal() once, rarely based on some MQL5 event.
How does your statement apply to my issue?
Unknown! I found that it failed 100% of the times I have tested it in the Strategy Tester, but there may be conditions unknown to me where it will work correctly. Instead, when I need to test such functionality, I do so "live" on a demo account.
However, I seldom use or rely on only the OnTradeTransaction() for tracking trades. I use it only as a secondary measure, and instead track the History, Orders and Positions directly, whenever a OnTrade() event occurs, or when a tick value change indicates possible changes in trade state.In my EA, I am not executing the standard OrdersTotal() function in a loop in the Tester.
I do call OrdersTotal() once, rarely based on some MQL5 event.
How does your statement apply to my issue?
Disregard my post. I was implying that I would replace the CHistoryOrderInfo code block with OrdersTotal() in a loop.
Fernando Carreiro has deemed that is outside of the scope of this thread, so my posts should be deleted.
In any event, good luck!
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
CHistoryOrderInfo StopLoss and TakeProfit values are 0.0 at OnTradeTransaction case TRADE_TRANSACTION_HISTORY_ADD when CHistoryOrderInfo TypeDescription = ORDER_TYPE_SELL
MQL5 never calls OnTradeTransaction with trans.type = TRADE_TRANSACTION_ORDER_ADD even when a new Order is added