Hello MQL4 community,
I am trying to conjure up a solution to create an "artificial order" and partially close this artificial order just as my EA would partially close a real order.
I want to do this because I wish to see if the last "artificial order" closed in netted profit or netted loss, so I can decide if a real order should be submitted next via my EA.
Has any coder had experience with this?
Does any coder have any thoughts or ideas that he/she wishes to share regarding this task?
I figured it out in my head. It took me a little while, but I figured it out.
I would simply store all values where iMA crosses would occur, subtract or add the values according to where they were plotted on the chart (above or below the iMA crossover where i would originally open sell or buy) throw in the spread with the calculations and *poof* I now know if the order would have profited or lost.
Thank you Simon.
William,
If this is the case, a variable spread value would be used in the calculations instead of a fixed value.
Makes nough' sense to me. What do you think?
Thank you.
![MQL5 - Language of trade strategies built-in the MetaTrader 5 client terminal](https://c.mql5.com/i/registerlandings/logo-2.png)
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Hello MQL4 community,
I am trying to conjure up a solution to create an "artificial order" and partially close this artificial order just as my EA would partially close a real order.
I want to do this because I wish to see if the last "artificial order" closed in netted profit or netted loss, so I can decide if a real order should be submitted next via my EA.
Has any coder had experience with this?
Does any coder have any thoughts or ideas that he/she wishes to share regarding this task?
Thank you.