Skip to content

Q & A 17 | Drawing a line at a stop loss level

How would I add a snippet so it shows on the chart a line/label where this stop is located once I enter my position?

Q & A 17 Program

Input: StopLossPct( 0.001 ); Vars: FastAvg( 0 ), SlowAvg( 0 ), StpLossAmt( 0 ), TckVal( Minmove / Pricescale ); Once SetStopShare; FastAvg = AverageFC( C, 9 ); SlowAvg = AverageFC( C, 18 ); If Currentbar > 1 and FastAvg Crosses Over SlowAvg then Buy Next Bar at Market; If Entryprice <> 0 then StpLossAmt = Entryprice * StopLossPct * BigPointValue
Else StpLossAmt = C * StopLossPct * BigPointValue; SetStopLoss( StpLossAmt ); Value2 = Round ( ( Entryprice * ( 1 - StopLossPct ) ) / TckVal , 0 ) * TckVal; Value1 = TL_New( D[1], T[1], Value2, D, T, Value2 );