Hello programmers,
I am a slow learner please forgive this amateur question. I hope you can please assist me or guide me please.
All I am trying to do is make the PDI Range greater than MDI adx range for 10 bars or more before buy is executed. I just don't understand "barssince" or if its being used correctly. Your help would seriously be most appreciated.
range = Param("Periods", 14, 2, 200, 1 );
Plot( ADX(range), _DEFAULT_NAME(), ParamColor( "ADX color", colorBlue ), ParamStyle("ADX style", styleThick ) );
Plot( PDI(range), "+DI", ParamColor( "+DI color", colorGreen ), ParamStyle("+DI style") );
Plot( MDI(range), "-DI", ParamColor( "-DI color", colorRed ), ParamStyle("-DI style") );
adx1 = PDI(Range) > MDI(Range);
Entry = BarsSince(adx1) <= 10
buy = Entry;
I am a slow learner please forgive this amateur question. I hope you can please assist me or guide me please.
All I am trying to do is make the PDI Range greater than MDI adx range for 10 bars or more before buy is executed. I just don't understand "barssince" or if its being used correctly. Your help would seriously be most appreciated.
range = Param("Periods", 14, 2, 200, 1 );
Plot( ADX(range), _DEFAULT_NAME(), ParamColor( "ADX color", colorBlue ), ParamStyle("ADX style", styleThick ) );
Plot( PDI(range), "+DI", ParamColor( "+DI color", colorGreen ), ParamStyle("+DI style") );
Plot( MDI(range), "-DI", ParamColor( "-DI color", colorRed ), ParamStyle("-DI style") );
adx1 = PDI(Range) > MDI(Range);
Entry = BarsSince(adx1) <= 10
buy = Entry;