Belal Chami:
I want to code a loop to close an order (effectively a stoploss). The order should be closed when the price drops below the lowest price (minus 2 pips) of either of the 3 bars immediately before the marker buy order.
show what you have tried.
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
I want to code a loop to close an order (effectively a stoploss). The order should be closed when the price drops below the lowest price (minus 2 pips) of either of the 3 bars immediately before the marker buy order.
I was thinking of using the CopyLow to get a history of the lowest price of an array of bars, but I am unsure how to do this relative to the current order. My EA script will only ever have one market order open at a time so I am not fussed with using functions to specifically locate a particular market order.
What is the best approach here?
Many thanks in advance