Hi folks after many many hours and days of reading and trying i'm asking for some help. this is my first attempt at a code so go easy.
I get the error wrong type message. i have ceaselessly tried what am i missing
in line 19, i cannot get past it. range= ( Trendhigh - Trendlow);
if it seems poor, remember i'm trying hard this end.
I appreciate your constructive input.
function run()
{
BarPeriod = 60;
Weekend = 0;
Lots = 10;
set(LOGFILE);
vars Price = series(price());
vars Pricelow = series(priceLow());
vars Trendlow = series(LowPass(priceLow,8));
vars Pricehigh = series(priceHigh());
vars Trendhigh = series(LowPass(priceHigh,8));
vars range(vars Trendhigh,vars Trendlow) ;
range =(Trendhigh - Trendlow);
var breakout = ((range * 10)/100);
//printf("Result = %.f",range);
if(Price< (Trendlow - breakout))
enterShort();
else Stop = 2*ATR(20);
exitShort(Price < (Trendlow - range));
if(Price > Trendhigh + breakout )
enterLong();
else Stop = 2*ATR(20);
exitLong( Price > Trendhigh + range);
}