My EA is bringing u weird errors with build 778. The volume of 0.1 is normalized and clearly not invalid.
Can you check the symbol properties for Silver and let us know what the SYMBOL_VOLUME_MIN and SYMBOL_VOLUME_STEP are please. It's not always enough just to Normalize, for example if your Volume Step were 0.5 then Normalize wouldn't help you.
RaptorUK: Can you check the symbol properties for Silver and let us know what the SYMBOL_VOLUME_MIN and SYMBOL_VOLUME_STEP are please. It's not always enough just to Normalize, for example if your Volume Step were 0.5 then Normalize wouldn't help you.
Is there any language where this syntax is valid ?
Perhaps, if the variables were of type bool it could make some sense. I have seen a few people do similar things on the mql4 forum, its a simple mistake to make.
That's working. _sl and _tp are global variables, it's surely better to process localy. trade is of CTrade class type. I suppose you can do the same with OrderSend().
Solution is as I said you, with OnTradeTransaction() event handler (DON'T USE THIS CODE AS IS, IT'S FOR TRIAL & TEST):
That's working. _sl and _tp are global variables, it's surely better to process localy. trade is of CTrade class type. I suppose you can do the same with OrderSend().
I'm staying away from the CTrade class in an attempt to learn the basics, I've never used OOP so classes, structures, etc are all part of my learning curve with mql5.
I'm sure OnTradeTransaction() would offer a workaround, but it seems like a fairly horrible one for me to use even for the simple EA I'm working on, there is also no mention of the need to use it in the documentation for OrderSend() and I think, I will confirm, that I have seen the same issue in the Strategy Tester, not sure how exactly this could happen, I'll try it again with some more error reporting added to make sure.
I'm staying away from the CTrade class in an attempt to learn the basics, I've never used OOP so classes, structures, etc are all part of my learning curve with mql5.
I'm sure OnTradeTransaction() would offer a workaround, but it seems like a fairly horrible one for me to use even for the simple EA I'm working on, there is also no mention of the need to use it in the documentation for OrderSend() and I think, I will confirm, that I have seen the same issue in the Strategy Tester, not sure how exactly this could happen, I'll try it again with some more error reporting added to make sure.
I understand your position about OOP. It always takesmore time than "tradional" approach and is realy useful for large (or medium) project.
I am very interested to know if it exist a "classic" solution for our problem.
My EA is bringing u weird errors with build 778. The volume of 0.1 is normalized and clearly not invalid.
Can you check the symbol properties for Silver and let us know what the SYMBOL_VOLUME_MIN and SYMBOL_VOLUME_STEP are please. It's not always enough just to Normalize, for example if your Volume Step were 0.5 then Normalize wouldn't help you.
This source
Gives this in the tester logs...
2013.03.12 12:46:01 Core 1 2013.01.23 13:32:59 volume step: 0.1, volume minimum: , 0.1
This source
Gives this in the tester logs...
2013.03.12 12:46:01 Core 1 2013.01.23 13:32:59 volume step: 0.1, volume minimum: , 0.1
The issue might be in your error reporting, I've not checked with mql5 but this will not work with mql4 . . .
instead try this . .
That got rid of the errors! Thx
Is there any language where this syntax is valid ?
Is there any language where this syntax is valid ?
Was this the thread you found ? https://www.mql5.com/en/forum/10850 it reports the same issue as I am having
I didn't see this thread.
Solution is as I said you, with OnTradeTransaction() event handler (DON'T USE THIS CODE AS IS, IT'S FOR TRIAL & TEST):
That's working. _sl and _tp are global variables, it's surely better to process localy. trade is of CTrade class type. I suppose you can do the same with OrderSend().
I didn't see this thread.
Solution is as I said you, with OnTradeTransaction() event handler (DON'T USE THIS CODE AS IS, IT'S FOR TRIAL & TEST):
That's working. _sl and _tp are global variables, it's surely better to process localy. trade is of CTrade class type. I suppose you can do the same with OrderSend().
I'm staying away from the CTrade class in an attempt to learn the basics, I've never used OOP so classes, structures, etc are all part of my learning curve with mql5.
I'm sure OnTradeTransaction() would offer a workaround, but it seems like a fairly horrible one for me to use even for the simple EA I'm working on, there is also no mention of the need to use it in the documentation for OrderSend() and I think, I will confirm, that I have seen the same issue in the Strategy Tester, not sure how exactly this could happen, I'll try it again with some more error reporting added to make sure.
I'm staying away from the CTrade class in an attempt to learn the basics, I've never used OOP so classes, structures, etc are all part of my learning curve with mql5.
I'm sure OnTradeTransaction() would offer a workaround, but it seems like a fairly horrible one for me to use even for the simple EA I'm working on, there is also no mention of the need to use it in the documentation for OrderSend() and I think, I will confirm, that I have seen the same issue in the Strategy Tester, not sure how exactly this could happen, I'll try it again with some more error reporting added to make sure.
I understand your position about OOP. It always takes more time than "tradional" approach and is realy useful for large (or medium) project.
I am very interested to know if it exist a "classic" solution for our problem.