Set trailing stop at bar range.

 

If I set a break even stop at say bar 2 range/4 and the trade executes, is bar 2's range calculated and the 1/4 of it stored somewhere as a variable? Because the profit might happen a few bars later. But I need EA to look at range of the original bar2 when trade was entered.

Thank you. 

 
ForexTrader17:

If I set a break even stop at say bar 2 range/4 and the trade executes, is bar 2's range calculated and the 1/4 of it stored somewhere as a variable? Because the profit might happen a few bars later. But I need EA to look at range of the original bar2 when trade was entered.

Thank you. 

2 ways. You can either store the info in a variable yourself when you take the trade and refer back to it later. Or simply recalculate the High/Low of that bar later on when you need to. 
 

You can also do a custom script for you that looks back range of xx bars to a particular bar or takes an average of the previous xx bars range and enters either stops or stops and target prices.  A script will be a one time action on all the positions of the chart you run the script on so it does not cause a problema with the EA or indicators you are running. 

I had one a few years ago and it was kind of clunky so I never follow-up but it always seemed like a good idea to me. 

Also the advantage of a script is that you run it when and where you want and could adjust the bars and percentage of the average range depending on the chart and pair/commodity that you were working with.

A FreeLancer here might be able to quote you on doing exactly what you want for a cheap Price.  I have not used freelancers at mql5.com but the prices I have seen look good.

Reason: