OPEN-SOURCE SCRIPT
TP Calculator (70% & 1.5x)

//version=5
indicator("TP Calculator (70% & 1.5x)", overlay=true)
// -------- Inputs --------
entry = input.float(100.0, "Entry Price")
stoploss = input.float(90.0, "Stop Loss")
// -------- Determine Direction --------
// اگر SL پایینتر بود = پوزیشن Long
// اگر SL بالاتر بود = پوزیشن Short
isLong = stoploss < entry ? true : false
// -------- Calculations --------
distance = math.abs(entry - stoploss)
// جهت پوزیشن (بالا یا پایین TP میرود)
direction = isLong ? 1 : -1
tp1 = entry + direction * (distance * 0.70) // 70%
tp2 = entry + direction * (distance * 1.50) // 1.5x
// -------- Plot Levels --------
plot(entry, "Entry", color=color.blue, linewidth=2)
plot(stoploss, "Stop Loss", color=color.red, linewidth=2)
plot(tp1, "TP1 (70%)", color=color.green, linewidth=2)
plot(tp2, "TP2 (1.5x)", color=color.orange, linewidth=2)
indicator("TP Calculator (70% & 1.5x)", overlay=true)
// -------- Inputs --------
entry = input.float(100.0, "Entry Price")
stoploss = input.float(90.0, "Stop Loss")
// -------- Determine Direction --------
// اگر SL پایینتر بود = پوزیشن Long
// اگر SL بالاتر بود = پوزیشن Short
isLong = stoploss < entry ? true : false
// -------- Calculations --------
distance = math.abs(entry - stoploss)
// جهت پوزیشن (بالا یا پایین TP میرود)
direction = isLong ? 1 : -1
tp1 = entry + direction * (distance * 0.70) // 70%
tp2 = entry + direction * (distance * 1.50) // 1.5x
// -------- Plot Levels --------
plot(entry, "Entry", color=color.blue, linewidth=2)
plot(stoploss, "Stop Loss", color=color.red, linewidth=2)
plot(tp1, "TP1 (70%)", color=color.green, linewidth=2)
plot(tp2, "TP2 (1.5x)", color=color.orange, linewidth=2)
نص برمجي مفتوح المصدر
بروح TradingView الحقيقية، قام مبتكر هذا النص البرمجي بجعله مفتوح المصدر، بحيث يمكن للمتداولين مراجعة وظائفه والتحقق منها. شكرا للمؤلف! بينما يمكنك استخدامه مجانًا، تذكر أن إعادة نشر الكود يخضع لقواعد الموقع الخاصة بنا.
إخلاء المسؤولية
The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.
نص برمجي مفتوح المصدر
بروح TradingView الحقيقية، قام مبتكر هذا النص البرمجي بجعله مفتوح المصدر، بحيث يمكن للمتداولين مراجعة وظائفه والتحقق منها. شكرا للمؤلف! بينما يمكنك استخدامه مجانًا، تذكر أن إعادة نشر الكود يخضع لقواعد الموقع الخاصة بنا.
إخلاء المسؤولية
The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.