inputs:
BelowRed( 20 ),
AboveBlue( 20 ),
rsilev(50),
Length( 14 ) [
DisplayName = "Length",
ToolTip = "Enter the number of bars over which to calculate the DMI."],
ADXTrend( 25 ) [ DisplayName = "ADXTrend", ToolTip = "Average Directional Movement Index Trend. Enter the level of the ADX above which an alert is triggered."];
variables:
ReturnValue( 0 ),
oDMIPlus( 0 ),
oDMIMinus( 0 ),
oDMI( 0 ),
oADX( 0 ),
oADXR( 0 ),
oVolty( 0 );
ReturnValue = DirMovement( H, L, C, Length, oDMIPlus, oDMIMinus, oDMI, oADX, oADXR,
oVolty );
{if oDMIPlus > oDMIMinus and oADX > 14 then buy 10000/c shares this bar close
else sell this bar close;}
if oDMIMinus < BelowRed and oDMIPlus > AboveBlue
and rsi(c,14) > rsilev
then buy 10000/c shares this bar Close
else sell this bar close;