Need help in stoploss placemant

#1
Dear Team,
Please refer attached image and kindly help in placing stoploss in below formula ...
stoploss will be lowest low value before 2 bars when buy was triggered ..


Formula

Buy=
( MACD( 5, 20 ) > Ref( MACD( 5, 20 ), -1 ) ) AND Ref( MACD( 5, 20 ), -1 ) < Ref( MACD( 5, 20 ), -2 )
AND Close >EMA(Close , 50)
AND Ref(L,-1) < Ref( EMA( C, 50 ), -1 )
//AND Ref(C,-2) > Ref( EMA( C, 50 ), -2 )
AND Ref(C,-3) > Ref( EMA( C, 50 ), -3 )
AND Ref(C,-4) > Ref( EMA( C, 50 ), -4 )
AND Ref(C,-5) > Ref( EMA( C, 50 ), -5 );


Short=

(MACD( 5, 20 ) < Ref( MACD( 5, 20 ), -1 ) ) AND Ref( MACD( 5, 20 ), -1 ) > Ref( MACD( 5, 20 ), -2 )
AND Close < EMA(Close , 50)
AND Ref(H,-1) > Ref( EMA( C, 50 ), -1 )
AND Ref(C,-3) < Ref( EMA( C, 50 ), -3 )
AND Ref(C,-4) < Ref( EMA( C, 50 ), -4 )
AND Ref(C,-5) < Ref( EMA( C, 50 ), -5 );

Filter = Buy OR Short;

//*******Plot Buy and Short Signal Arrows********//
shape = Buy * shapeUpArrow + Short * shapeDownArrow;
PlotShapes( shape, IIf( Buy, colorAqua, colorRed ), 0, IIf( Buy, Low, High ) );
GraphXSpace = 5;


AddColumn( Close, "Close " );
AddColumn( Open, "Open " );
AddColumn( High, "High " );
AddColumn( Low, "Low " );
AddColumn( Volume, "Volume " );
 

Attachments

#2
I am surprised nobody answered this for so long. I prefer using ATR stop, by getting the ATR value multiplied by 2 for 5 min and ATR value multiplied by 1.5 for 15 mins. I hope this helps.
 

Similar threads