PINE LIBRARY
tradeEngine

Library "tradeEngine"
calculateLiquidationPrice(entryPrice, isLong, leverage, buffer)
Parameters:
entryPrice (float)
isLong (bool)
leverage (int)
buffer (float)
calculateTPLevels(entryPrice, atr, isLong, risk)
Parameters:
entryPrice (float)
atr (float)
isLong (bool)
risk (RiskConfig)
calculateSL(entryLow, entryHigh, isLong, risk)
Parameters:
entryLow (float)
entryHigh (float)
isLong (bool)
risk (RiskConfig)
simulateTrade(highs, lows, closes, entryIdx, entryPrice, entryLow, entryHigh, entryATR, isLong, risk, maxBars)
Parameters:
highs (array<float>)
lows (array<float>)
closes (array<float>)
entryIdx (int)
entryPrice (float)
entryLow (float)
entryHigh (float)
entryATR (float)
isLong (bool)
risk (RiskConfig)
maxBars (int)
createRiskConfig(leverage, liqBuffer, useTP1, tp1ATR, useTP2, tp2ATR, useSL, slBuffer, maker, taker, slip)
Parameters:
leverage (int)
liqBuffer (float)
useTP1 (bool)
tp1ATR (float)
useTP2 (bool)
tp2ATR (float)
useSL (bool)
slBuffer (float)
maker (float)
taker (float)
slip (float)
TradeResult
Fields:
exitType (series string)
exitBarIdx (series int)
exitPrice (series float)
finalPnL (series float)
maxPnL (series float)
tp1Hit (series bool)
tp2Hit (series bool)
slHit (series bool)
liquidated (series bool)
barsInTrade (series int)
tp1Level (series float)
tp2Level (series float)
slLevel (series float)
liqLevel (series float)
RiskConfig
Fields:
leverage (series int)
liquidationBuffer (series float)
useTP1 (series bool)
tp1ATR (series float)
useTP2 (series bool)
tp2ATR (series float)
useFixedSL (series bool)
slBuffer (series float)
makerFee (series float)
takerFee (series float)
slippage (series float)
calculateLiquidationPrice(entryPrice, isLong, leverage, buffer)
Parameters:
entryPrice (float)
isLong (bool)
leverage (int)
buffer (float)
calculateTPLevels(entryPrice, atr, isLong, risk)
Parameters:
entryPrice (float)
atr (float)
isLong (bool)
risk (RiskConfig)
calculateSL(entryLow, entryHigh, isLong, risk)
Parameters:
entryLow (float)
entryHigh (float)
isLong (bool)
risk (RiskConfig)
simulateTrade(highs, lows, closes, entryIdx, entryPrice, entryLow, entryHigh, entryATR, isLong, risk, maxBars)
Parameters:
highs (array<float>)
lows (array<float>)
closes (array<float>)
entryIdx (int)
entryPrice (float)
entryLow (float)
entryHigh (float)
entryATR (float)
isLong (bool)
risk (RiskConfig)
maxBars (int)
createRiskConfig(leverage, liqBuffer, useTP1, tp1ATR, useTP2, tp2ATR, useSL, slBuffer, maker, taker, slip)
Parameters:
leverage (int)
liqBuffer (float)
useTP1 (bool)
tp1ATR (float)
useTP2 (bool)
tp2ATR (float)
useSL (bool)
slBuffer (float)
maker (float)
taker (float)
slip (float)
TradeResult
Fields:
exitType (series string)
exitBarIdx (series int)
exitPrice (series float)
finalPnL (series float)
maxPnL (series float)
tp1Hit (series bool)
tp2Hit (series bool)
slHit (series bool)
liquidated (series bool)
barsInTrade (series int)
tp1Level (series float)
tp2Level (series float)
slLevel (series float)
liqLevel (series float)
RiskConfig
Fields:
leverage (series int)
liquidationBuffer (series float)
useTP1 (series bool)
tp1ATR (series float)
useTP2 (series bool)
tp2ATR (series float)
useFixedSL (series bool)
slBuffer (series float)
makerFee (series float)
takerFee (series float)
slippage (series float)
Pine kitaplığı
Gerçek TradingView ruhuyla, yazar bu Pine kodunu açık kaynaklı bir kütüphane olarak yayınladı, böylece topluluğumuzdaki diğer Pine programcıları onu yeniden kullanabilir. Yazarı tebrik ederiz! Bu kütüphaneyi özel olarak veya diğer açık kaynaklı yayınlarda kullanabilirsiniz, ancak bu kodun yayınlarda yeniden kullanılması Topluluk Kuralları tarafından yönetilir.
Feragatname
Bilgiler ve yayınlar, TradingView tarafından sağlanan veya onaylanan finansal, yatırım, alım satım veya diğer türden tavsiye veya öneriler anlamına gelmez ve teşkil etmez. Kullanım Koşulları bölümünde daha fazlasını okuyun.
Pine kitaplığı
Gerçek TradingView ruhuyla, yazar bu Pine kodunu açık kaynaklı bir kütüphane olarak yayınladı, böylece topluluğumuzdaki diğer Pine programcıları onu yeniden kullanabilir. Yazarı tebrik ederiz! Bu kütüphaneyi özel olarak veya diğer açık kaynaklı yayınlarda kullanabilirsiniz, ancak bu kodun yayınlarda yeniden kullanılması Topluluk Kuralları tarafından yönetilir.
Feragatname
Bilgiler ve yayınlar, TradingView tarafından sağlanan veya onaylanan finansal, yatırım, alım satım veya diğer türden tavsiye veya öneriler anlamına gelmez ve teşkil etmez. Kullanım Koşulları bölümünde daha fazlasını okuyun.