4000:
Hello,
I'm trying to code a repeating (looping) function. I'm not looking for the entire program (EA), just the function that will do the following:
Buy at price A
Place stop at A-50
If stopped out buy again at A+50
Place new stop at A
If stopped out buy again at A+100
Place new stop at A-50
Keep repeating indefinitely.
As you can see, the stop is always a consistent distance behind the entry (in this case 50 pips)
Whenever we are stopped out a new order is placed a consistent distance above the price that was just stopped out. (in this case 100 pips)
Thanks in advance for the help.
Brian
keep trying
for help show your attempt

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,
I'm trying to code a repeating (looping) function. I'm not looking for the entire program (EA), just the function that will do the following:
Buy at price A
Place stop at A-50
If stopped out buy again at A+50
Place new stop at A
If stopped out buy again at A+100
Place new stop at A-50
Keep repeating indefinitely.
As you can see, the stop is always a consistent distance behind the entry (in this case 50 pips)
Whenever we are stopped out a new order is placed a consistent distance above the price that was just stopped out. (in this case 100 pips)
Thanks in advance for the help.
Brian