FXD EA has issue trading symbol that uses 0.5point increment
-
Hi Radoslav and fellow traders,
I am trying to create an EA that will trade the DAX (ger30) and it seems some brokers provide a data feed where price moves by 0.5 point increments. I am having trouble finding out how to have the EA avoid other decimal numbers than .0 and .5 for entry, sl and tp.
So for example, the DAX is trading at 11408.5 now. The next tick to the upside with some brokers would be 11409.0 (skipping .6, .7, .8 and .9) so if one would try to place a pending order or order a TP or SL at any price that uses a different decimal than .0 or .5, the server will return error 130 and/or returns an error saying something like like "[Invalid S/L or T/P]".
I have thought about manually modifying the NormalizeDouble value(s) to "0" in the code if there is no other option, but I have trouble to find the right NormalizeDouble lines to do that with and this would also mean .5 levels will never be used.If I am missing something or if any sollution comes to mind, I would appreciate the help.
Thanks very much in advance for your reply!
Best regards,Saf
-
Maybe you are doing something wrong. I don't know, and no one ever reported that SL ot TP does not work when they are set on the right side of the open price. Are you sure that you are not placing SL or TP on the other side?
Or if there is really something with this 0.5 point, can you tell me the broker so I can test it, and some simple project if possible.
-
Hi Radoslav,
Thank you for your swift response. I am quite sure I'm not doing anything wrong, but I am also sure there must be something I can do to prevent the issue from occuring.
Note that when trying to place a pending order manually on a price that ends with a decimal that's not .0 or .5, the server will return the error as well. So I would asume it's definitely a broker/data feed thing. If I would just be able to make the EA avoid those 8 other decimal digits, the issue would be solved.Here's a broker that uses a 0.5 increment on for example the symbol Ger30Sep15: https://www.activtrades.com/
Here's a simple project that uses a 14 SMA to place its orders with an offset from the current price: https://fxdreema.com/shared/rFOj02bZb
Even if no SL or TP is being sent with the order, the server will still return an error like this 80% of the time: "'1106597': order buy stop 0.10 Ger30Sep15 opening at 11581.9 sl: 0.0 tp: 0.0 failed [Invalid S/L or T/P]"Any help would be so much appreciated. Even if it would mean having NormalizeDouble set to 0 for all SL, TP and Entry levels the EA orders if there's no other way.
Again, thanks so much in advance,
Best regards,Saf
-
I'm gonna test that. It's the first time that someone reports such thing to me, I was not aware of it, but I will try to fix the problem
-
-
Thank you for trying it out and taking the time to post some screenshots, but the prices you are placing the orders at, end with .0 and .5. An EA based on MA's or BB's or something like that will try to order at price levels ending with .1, .2, .3, .4, .6, .7, .8 and .9 as well (try this simple EA for example: https://fxdreema.com/shared/rFOj02bZb ). This will give you errors like this 80% of the time or more:
By EA (journal): https://charts.mql5.com/8/182/ger30sep1 ... es-plc.png
By EA (experts): https://charts.mql5.com/8/183/ger30sep1 ... es-plc.png
Manually (journal: https://charts.mql5.com/8/183/ger30sep1 ... -plc-2.png
So if one would try to place a pending order manually (F9) on a price that doesnt end with .0 or .5, the server will return the error as well. I can't find a sollution and there are so many NormalizeDouble lines in the code, I can't figure out where to set what to 0.
If you might think of any sollution that would help me excluse all other decimals from being used for entry, sl and tp, I would appreciate it so much.Thanks again,
Saf
-
Right, MovingAverage can give any type of value. I will try is and then I will fix it.
-
Is it working now?
-
Yes! It works! That is awesome man! Thank you so, so very much!!!!
