Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // =================== P/L ticks calculation ==================//
- TargetProfit_ticks := TargetProfit_amount==0? na : ( PT_SL__Type=="ticks" ? TargetProfit_amount : ( PT_SL__Type=="amount" ? floor((TargetProfit_amount/tickValue)/contracts_amount) : ( change_to_ANY ? (entry_price * (TargetProfit_amount/100))/tickSize : TargetProfit_ticks[1] ) ) )
- StopLoss_ticks := StopLoss_amount ==0 ? na : ( PT_SL__Type=="ticks" ? StopLoss_amount : ( PT_SL__Type=="amount" ? floor((TargetProfit_amount/tickValue)/contracts_amount) : ( change_to_ANY ? (entry_price * (StopLoss_amount/100))/tickSize : StopLoss_ticks[1] ) ) )
- // show_ProfitLoss_lines = input(false)
- //PT
- // TargetProfit_line = 0.0
- // TargetProfit_line := bar_index<=1 ? 0 : position_ == 0 ? na : change_to_LONG[trade_index] ? entry_price + TargetProfit_ticks*tickSize : TargetProfit_line[1]
- // plot( not show_ProfitLoss_lines ? na : position_ == 0 ? na : TargetProfit_line, color=color.green, style=plot.style_circles, linewidth=2)
- //SL
- // StopLoss_line = 0.0
- // StopLoss_line := bar_index<=1 ? 0 : position_ == 0 ? na : change_to_LONG[trade_index] ? entry_price - StopLoss_ticks*tickSize : StopLoss_line[1]
- // plot( not show_ProfitLoss_lines ? na : position_ == 0 ? na : StopLoss_line, color=color.red, style=plot.style_circles, linewidth=2)
- // ============================================================//
- // =============== INDICATOR ONLY ====================
- //manual PT
- // TargetProfit_met = position_ == 0 ? false : high >= TargetProfit_line
- // plotchar(TargetProfit_met ? TargetProfit_line : na, char="X", text="TargetProfit", size=size.tiny, location=location.absolute, color=color.green)
- // if (TargetProfit_met)
- // position_ := 0
- //manual SL
- // StopLoss_met = position_ == 0 ? false : low <= StopLoss_line
- // plotchar(StopLoss_met ? StopLoss_line : na, char="X", text="StopLoss", size=size.tiny, location=location.absolute, color=color.red)
- // if (StopLoss_met)
- // position_ := 0
- // plotarrow(final_long_ENTRY ? 1 : na, title="Up Arrow", colorup=color.lime, maxheight=60, minheight=50, transp=0)
- // plotarrow(final_long_EXIT ? -1 : na, title="Down Arrow", colordown=color.red, maxheight=60, minheight=50, transp=0)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement