retesere20

--indi-part-tv-2

Sep 22nd, 2019
85
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  
  2. // =================== P/L ticks calculation ==================//
  3. 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] ) ) )
  4. 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] ) ) )
  5.  
  6. // show_ProfitLoss_lines = input(false)
  7. //PT
  8. // TargetProfit_line = 0.0
  9. // TargetProfit_line := bar_index<=1 ? 0 : position_ == 0 ? na : change_to_LONG[trade_index] ? entry_price + TargetProfit_ticks*tickSize : TargetProfit_line[1]
  10. // plot( not show_ProfitLoss_lines ? na : position_ == 0 ? na : TargetProfit_line, color=color.green, style=plot.style_circles, linewidth=2)
  11.  
  12. //SL
  13. // StopLoss_line = 0.0
  14. // StopLoss_line := bar_index<=1 ? 0 : position_ == 0 ? na : change_to_LONG[trade_index] ? entry_price - StopLoss_ticks*tickSize : StopLoss_line[1]
  15. // plot( not show_ProfitLoss_lines ? na : position_ == 0 ? na : StopLoss_line, color=color.red, style=plot.style_circles, linewidth=2)
  16. // ============================================================//
  17.  
  18.  
  19.  
  20.  
  21. // =============== INDICATOR ONLY ====================
  22. //manual PT
  23. // TargetProfit_met = position_ == 0 ? false : high >= TargetProfit_line
  24. // plotchar(TargetProfit_met ? TargetProfit_line : na, char="X", text="TargetProfit", size=size.tiny, location=location.absolute, color=color.green)
  25. // if (TargetProfit_met)
  26. // position_ := 0
  27.  
  28. //manual SL
  29. // StopLoss_met = position_ == 0 ? false : low <= StopLoss_line
  30. // plotchar(StopLoss_met ? StopLoss_line : na, char="X", text="StopLoss", size=size.tiny, location=location.absolute, color=color.red)
  31. // if (StopLoss_met)
  32. // position_ := 0
  33.  
  34. // plotarrow(final_long_ENTRY ? 1 : na, title="Up Arrow", colorup=color.lime, maxheight=60, minheight=50, transp=0)
  35. // plotarrow(final_long_EXIT ? -1 : na, title="Down Arrow", colordown=color.red, maxheight=60, minheight=50, transp=0)
RAW Paste Data