If you have an indicator, and buy/sell/short/cover and/or stoploss criteria, you can put the following code below.
This shows entry/exit value's with discription.
one important thing before use is to change is the base_array.
base_array = =????
replace the =???? with the value which is used to plot the indicator.
it's meant eod and use the opening of the next day als entry/exit.
(but this is depended on how the applystop is setup)
very nice, so here ya go.
// change the questionmarks the the value which is used to plot the indicator
base_array=??? ;
////////////////////////////// HIGHLY IMPORTANT ////////////////////
//ACTIVATE STOPS IN SETTINGS
e = Equity(1,0); /* Highly Important!!. "Removes all extra signals, evaluates
stops AND writes BACK signals to Sell/Cover arrays". As it should be!!*/
PlotShapes( Buy* shapeUpArrow , colorBlack, 0);
PlotShapes( Short* shapeDownArrow , colorBlack, 0);
/*
1 - regular exit
2 - Max. loss
3 - profit target
4 - trailing
5 - ruin stop
6 - n-bar stop
*/
PlotShapes(IIf(Cover==2, shapeCircle, shapeNone),colorRed,0,base_array,0); //stoploss
PlotShapes(IIf(Cover==3, shapeCircle, shapeNone),colorGreen,0,base_array,0); //profit target
PlotShapes(IIf(Sell==2, shapeCircle, shapeNone),colorRed,0,base_array,0); //stoploss
PlotShapes(IIf(Sell==3, shapeCircle, shapeNone),colorGreen,0,base_array,0); //profit target
////////////////////////////////////////////////////////////////////////////////
OffsetBuy = Param("Offset_Buy ", -9, -25, 25, 1 );
OffsetSell = Param("Offset_Sell ", 2, -25, 25, 1 );
OffsetShort = Param("Offset_Short ", 7, -25, 25, 1 );
OffsetCover = Param("Offset_Cover ", -3, -25, 25, 1 );
OND=Ref(O,1); //OPEN NEXT DAY
base_arrayBUY=base_array+OffsetBuy ; //just for offset
base_arraySELL=base_array+OffsetSell ; //just for offset
base_arraySHORT=base_array+OffsetShort ; //just for offset
base_arrayCOVER=base_array+OffsetCover ; //just for offset
for( i = 0; i < BarCount; i++ )
{
if( Buy ) PlotText( "EL " + OND[ i ], i, base_arrayBUY[ i ], colorGreen );
if( Sell AND NOT Short ) PlotText( "LE " + OND[ i ], i, base_arraySELL[ i ], colorBlue);
if( Short ) PlotText( "ES " + OND[ i ], i, base_arraySHORT[ i ], colorRed);
if( Cover AND NOT Buy ) PlotText( "SE " + OND[ i ], i, base_arrayCOVER[ i ], colorOrange);
}
////////////////////////////////////////////////////////////////////////////////
_SECTION_BEGIN("trending ribbon");
GraphXSpace=15;
uptrend=Buy;
downtrend=Short;
Plot( 2, "ribbon",IIf( uptrend, colorGreen, IIf( downtrend, colorRed, colorLavender )), styleOwnScale|styleArea|styleNoLabel, -0.5, 100 );
_SECTION_END();
//////////////////////////////////////////////////////////////////////////////
This shows entry/exit value's with discription.
one important thing before use is to change is the base_array.
base_array = =????
replace the =???? with the value which is used to plot the indicator.
it's meant eod and use the opening of the next day als entry/exit.
(but this is depended on how the applystop is setup)
very nice, so here ya go.
// change the questionmarks the the value which is used to plot the indicator
base_array=??? ;
////////////////////////////// HIGHLY IMPORTANT ////////////////////
//ACTIVATE STOPS IN SETTINGS
e = Equity(1,0); /* Highly Important!!. "Removes all extra signals, evaluates
stops AND writes BACK signals to Sell/Cover arrays". As it should be!!*/
PlotShapes( Buy* shapeUpArrow , colorBlack, 0);
PlotShapes( Short* shapeDownArrow , colorBlack, 0);
/*
1 - regular exit
2 - Max. loss
3 - profit target
4 - trailing
5 - ruin stop
6 - n-bar stop
*/
PlotShapes(IIf(Cover==2, shapeCircle, shapeNone),colorRed,0,base_array,0); //stoploss
PlotShapes(IIf(Cover==3, shapeCircle, shapeNone),colorGreen,0,base_array,0); //profit target
PlotShapes(IIf(Sell==2, shapeCircle, shapeNone),colorRed,0,base_array,0); //stoploss
PlotShapes(IIf(Sell==3, shapeCircle, shapeNone),colorGreen,0,base_array,0); //profit target
////////////////////////////////////////////////////////////////////////////////
OffsetBuy = Param("Offset_Buy ", -9, -25, 25, 1 );
OffsetSell = Param("Offset_Sell ", 2, -25, 25, 1 );
OffsetShort = Param("Offset_Short ", 7, -25, 25, 1 );
OffsetCover = Param("Offset_Cover ", -3, -25, 25, 1 );
OND=Ref(O,1); //OPEN NEXT DAY
base_arrayBUY=base_array+OffsetBuy ; //just for offset
base_arraySELL=base_array+OffsetSell ; //just for offset
base_arraySHORT=base_array+OffsetShort ; //just for offset
base_arrayCOVER=base_array+OffsetCover ; //just for offset
for( i = 0; i < BarCount; i++ )
{
if( Buy ) PlotText( "EL " + OND[ i ], i, base_arrayBUY[ i ], colorGreen );
if( Sell AND NOT Short ) PlotText( "LE " + OND[ i ], i, base_arraySELL[ i ], colorBlue);
if( Short ) PlotText( "ES " + OND[ i ], i, base_arraySHORT[ i ], colorRed);
if( Cover AND NOT Buy ) PlotText( "SE " + OND[ i ], i, base_arrayCOVER[ i ], colorOrange);
}
////////////////////////////////////////////////////////////////////////////////
_SECTION_BEGIN("trending ribbon");
GraphXSpace=15;
uptrend=Buy;
downtrend=Short;
Plot( 2, "ribbon",IIf( uptrend, colorGreen, IIf( downtrend, colorRed, colorLavender )), styleOwnScale|styleArea|styleNoLabel, -0.5, 100 );
_SECTION_END();
//////////////////////////////////////////////////////////////////////////////
Last edited: