wajo111

New Member
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( PDI(range), "+DI", ParamColor( "+DI color", colorGreen ), ParamStyle("+DI style") );
Plot( MDI(range), "-DI", ParamColor( "-DI color", colorRed ), ParamStyle("-DI style") );

extremist

Well-Known Member
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( PDI(range), "+DI", ParamColor( "+DI color", colorGreen ), ParamStyle("+DI style") );
Plot( MDI(range), "-DI", ParamColor( "-DI color", colorRed ), ParamStyle("-DI style") );

i think u just missed semicolon at the end.

Enjoy...

mastermind007

Well-Known Member
I think you would need

Code:
``````adx1 = Cross(PDI(Range), MDI(Range));
As extremist already pointed out, you had missed one semi colon on line defining Entry variable.

Romeo1998

Well-Known Member
Dear friend,
use this code
The yellow arrow 0n chart is when PDI crosses MDI from below
and the red arrow is on the 10th bar after the cross
Code:
``````_SECTION_BEGIN("ADX");
SetChartOptions(0,0,0);
range = Param("Periods", 14, 2, 200, 1 );
Plot( PDI(range), "+DI", ParamColor( "+DI color", colorGreen ), ParamStyle("+DI style") );
Plot( MDI(range), "-DI", ParamColor( "-DI color", colorRed ), ParamStyle("-DI style") );

adx1 = Cross (PDI(range) , MDI(range));