You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
Hello angevoyageur,
find attached a simple EA which demonstrates the problem. The EA opens long along with stop and target then short, then long and so on.
A dump method is also contained. Just apply EUR.USD 1 minute 1 week and watch the transaction dumps in backtest log.
Thank you for help.
Here your stoploss is triggered :
2013.05.07 18:45:27 Core 1 2013.05.03 18:35:40 trans=symbol=EURUSD price=1.3104000 volume=0.01 sl=0.0000000 tp=0.0000000 order=107 deal=107 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
Here your stoploss is triggered :
2013.05.07 18:45:27 Core 1 2013.05.03 18:35:40 trans=symbol=EURUSD price=1.3104000 volume=0.01 sl=0.0000000 tp=0.0000000 order=107 deal=107 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
Hello,
but this is entry-type=IN , not out....
Hello,
but this is entry-type=IN , not out....
Maybe, but it's your sl triggered nevertheless. Never religiously believe what a program tells you ;-)
You are right, on the other hand, how can i know that i can rely on sl=0.0 and tp=0.0 means this is stop or target order and not: sl and tp simply missed (in the transaction structure)..?
You are right, on the other hand, how can i know that i can rely on sl=0.0 and tp=0.0 means this is stop or target order and not: sl and tp simply missed (in the transaction structure)..?
A structure can't have missing field. This is transaction about a deal (DEAL_TYPE_SELL), a deal can't have a SL/TP, that make no sense. A SL (or TP) is an order (a sort of special pending order), when it is triggered, the order result in a deal. You can check all of that within OnTradeTransaction.
A structure can't have missing field. This is transaction about a deal (DEAL_TYPE_SELL), a deal can't have a SL/TP, that make no sense. A SL (or TP) is an order (a sort of special pending order), when it is triggered, the order result in a deal. You can check all of that within OnTradeTransaction.
I do not mean the structure members of course;i mean values.
So? It is a little confusing, can I still help?
Yes, was a help. What do mean byconfusing? I wondered about getting always ENTRY_IN. You said never believe on what program tells me. I say, you are right, so sl=0.0 or tp=0.0 (missed values) could also a mistake by server - forgot to wroite values.
What is important for me: a save method to determine what transaction is stop out. MT is great but in many aspects, confusing, not doing what you normally would expect, like in this case.
Do you know what i mean ?
Yes, was a help. What do mean byconfusing? I wondered about getting always ENTRY_IN. You said never believe on what program tells me. I say, you are right, so sl=0.0 or tp=0.0 (missed values) could also a mistake by server - forgot to wroite values.
What is important for me: a save method to determine what transaction is stop out. MT is great but in many aspects, confusing, not doing what you normally would expect, like in this case.
Do you know what i mean ?
Yes, was a help. What do mean byconfusing? I wondered about getting always ENTRY_IN. You said never believe on what program tells me. I say, you are right, so sl=0.0 or tp=0.0 (missed values) could also a mistake by server - forgot to wroite values.
What is important for me: a save method to determine what transaction is stop out. MT is great but in many aspects, confusing, not doing what you normally would expect, like in this case.
Do you know what i mean ?
I checked. When a SL/TP is triggered you have these transaction :
TRADE_TRANSACTION_POSITION
Changing a position not related to a deal execution. This type of transaction shows that a position has been changed on a trade server side. Position volume, open price, Stop Loss and Take Profit levels can be changed. Data on changes are submitted in MqlTradeTransaction structure via OnTradeTransaction handler. Position change (adding, changing or closing), as a result of a deal execution, does not lead to the occurrence of TRADE_TRANSACTION_POSITION transaction.