Compile error, can someone try compile volatility indicator

Questions about MultiCharts and user contributed studies.
pipsqueek
Posts: 29
Joined: Mar 27 2006

Nov 14 2006

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;

jack

Nov 14 2006

the code looks as if it is a signal not an indicator, correct?

pipsqueek
Posts: 29
Joined: Mar 27 2006

Nov 14 2006

Its supposed to be a volatility breakout system.

SP
Posts: 465
Joined: Feb 06 2006
Has thanked: 36 times
Been thanked: 286 times

Nov 15 2006

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]