Input: p(13),s(13),f(0.5);
IF c<c[1] and c>average(c,p) Then Buy c+f*(h-l) Stop;
ExitLong at high limit;
IF c>c[1] and c<average(c,s) Then Sell c-f*(h-l) Stop;
ExitShort at low limit;
Compile error, can someone try compile volatility indicator
Stop and limit orders need "this bar" or "next bar".
This should work:
[code]
IF c<c[1] and c>average(c,p) Then Buy next bar at c+f*(h-l) stop;
ExitLong next bar at high limit;
IF c>c[1] and c<average(c,s) Then Sell next bar at c-f*(h-l) Stop;
ExitShort next bar at low limit;[/code]
This should work:
[code]
IF c<c[1] and c>average(c,p) Then Buy next bar at c+f*(h-l) stop;
ExitLong next bar at high limit;
IF c>c[1] and c<average(c,s) Then Sell next bar at c-f*(h-l) Stop;
ExitShort next bar at low limit;[/code]