نص 2
نص 2
//@version=5
// GLOBAL VARIABLES
//
â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–
‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â
–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘
â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–
‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â
–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘
â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘
// Inputs
//
â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–
‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â
–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘
â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–
‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â
–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘
â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘
])
// ————� MAIN
// ————� Filter
// ————� Strategie TP SL
// Asset Settings
//
â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–
‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â
–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘
â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–
‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â
–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘
â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘
if asset == "MATIC/USDT.P 30m | Mid Term"
sensitivity := 350
filterAct := false
TP1 := 1.5
TP2 := 3.5
TP3 := 5.5
TP4 := 10
SL := 5
dcaAct := true
dacValue := "5"
// Main
//
â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–
‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â
–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘
â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–
‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â
–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘
â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘â–‘
//Truncate Function
//-----------------------------------------------------------------------------}
// STRATEGY
//sensitivity *= sensitivity2
//sensitivity *= 10
imba_trend_line = fib_5
SL_Line = fib_456
//filtering
updm = ta.change(high)
downdm = -ta.change(low)
can_long := close >= imba_trend_line and close >= fib_236 and not is_long_trend
and trendType
can_short := close <= imba_trend_line and close <= fib_786 and not
is_short_trend and trendType
// CAN LONG/SHORT
if can_long
is_long_trend := true
is_short_trend := false
else if can_short
is_short_trend := true
is_long_trend := false
else
is_trend_change := false
can_long := false
can_short := false
is_short_trend_started := false
is_long_trend_started := false
is_trend_change := is_short_trend_started or is_long_trend_started
ruleState = 0
// Strategy
strategy.entry("Long", strategy.long)
imba_entry_long_line := imba_trend_line
strategy.entry("Short", strategy.short)
imba_entry_short_line := imba_trend_line
if (_use)
trailing_sl_long = 0.0
trailing_sl_short = 0.0
// Logic SL TP ----------------------------------------
//
bool status_long_hit_tp1 = na
bool status_short_hit_tp1 = na
//
//Calculate levels
////////////////////////////////////////////////////////////////////////////////
SETUP EXIT
if multiprofit == true
if multiprofit == false
////////////////////////////////////////////////////////////////////////////////
Plot TP & SL
entryLongThree :=
math.round_to_mintick(math.avg(strategy.position_avg_price,imba_entry_long_line))
entryLongTwo :=
math.round_to_mintick(math.avg(strategy.position_avg_price,entryLongThree))
entryLongFour :=
math.round_to_mintick(math.avg(entryLongThree,imba_entry_long_line))
entryShortThree :=
math.round_to_mintick(math.avg(strategy.position_avg_price,imba_entry_short_line))
entryShortTwo :=
math.round_to_mintick(math.avg(strategy.position_avg_price,entryShortThree))
entryShortFour :=
math.round_to_mintick(math.avg(entryShortThree,imba_entry_short_line))
//Label TP/SL
_x = timenow + math.round(ta.change(time) * 2)
label.delete(Label)
Label
label.delete(Label)
Label
if multiprofit == true
if dcaAct == true
// 2 Rebuy
if dacValue == "2"
draw_label_entry(strategy.position_avg_price,
strategy.position_avg_price, "â–? Entry Zone Long ", "â–? Entry Zone Short",
"Entry 1", "Entry 1", color.new(#004cff, 30))
// 3 Rebuy
if dacValue == "3"
draw_label_entry(strategy.position_avg_price,
strategy.position_avg_price, "â–? Entry Zone Long ", "â–? Entry Zone Short",
"Entry 1", "Entry 1", color.new(#004cff, 30))
// 5 Rebuy
if dacValue == "5"
draw_label_entry(strategy.position_avg_price,
strategy.position_avg_price, "â–? Entry Zone Long ", "â–? Entry Zone Short",
"Entry 1", "Entry 1", color.new(#004cff, 30))
else
draw_label_entry(strategy.position_avg_price, strategy.position_avg_price,
"Entry Long ", "Entry Short", "Entry 1", "Entry 1", color.new(#004cff, 30))
draw_label(strategy.position_avg_price + percentTPSL(TP1)*syminfo.mintick,
strategy.position_avg_price - percentTPSL(TP1)*syminfo.mintick, "🎯 Long TP1",
"🎯 Short TP1", TP1, TP1, color.new(#14ca3b, 30))
draw_label(strategy.position_avg_price + percentTPSL(TP2)*syminfo.mintick,
strategy.position_avg_price - percentTPSL(TP2)*syminfo.mintick, "🎯 Long TP2",
"🎯 Short TP2", TP2, TP2, color.new(#14ca3b, 30))
draw_label(strategy.position_avg_price + percentTPSL(TP3)*syminfo.mintick,
strategy.position_avg_price - percentTPSL(TP3)*syminfo.mintick, "🎯 Long TP3",
"🎯 Short TP3", TP3, TP3, color.new(#14ca3b, 30))
draw_label(strategy.position_avg_price + percentTPSL(TP4)*syminfo.mintick,
strategy.position_avg_price - percentTPSL(TP4)*syminfo.mintick, "🎯 Long TP4",
"🎯 Short TP4", TP4, TP4, color.new(#14ca3b, 30))
draw_label(strategy.position_avg_price + percentTPSL(TP4)*syminfo.mintick,
strategy.position_avg_price - percentTPSL(TP4)*syminfo.mintick, "🎯 Long TP5",
"🎯 Short TP5", TP4, TP4, color.new(#14ca3b, 30))
closedTrades = strategy.closedtrades
winTrades = strategy.wintrades
lossTrades = strategy.losstrades
lossRow := 0
winRow := winRow + 1
maxWinRow := winRow
if newLoss
winRow := 0
lossRow := lossRow + 1
maxLossRow := lossRow
MyDate := time
_text +=
'            Total📊 BUY📈 SELL📉�' + '\n'
_text +=
'â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â
•'+ '\n'
if tradeIdeeAct == true
_text +=
'â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â
•'+ '\n\n'
// DCA Activate
if dcaAct == true
// 2 Rebuy
if dacValue == "2"
if dacValue == "3"
else
if multiprofit == true
if oppositeSignalACT
if trailingConfigurationACT
else
_text += na
label la = na
label.delete(la[1])