PINE LIBRARY

SPX_0DTE_Engine

82
Library "SPX_0DTE_Engine"

getATM(price)
  Parameters:
    price (float)

getCallStrikes(atmStrike, count)
  Parameters:
    atmStrike (int)
    count (int)

getPutStrikes(atmStrike, count)
  Parameters:
    atmStrike (int)
    count (int)

generateOCCSymbol(underlying, year, month, day, optionType, strike)
  Parameters:
    underlying (string)
    year (int)
    month (int)
    day (int)
    optionType (string)
    strike (int)

getAdaptiveReference(src, lookback)
  Parameters:
    src (float)
    lookback (int)

detectLiquidityGrabHigh(high, low, close, volume, lookback)
  Parameters:
    high (float)
    low (float)
    close (float)
    volume (float)
    lookback (int)

detectLiquidityGrabLow(high, low, close, volume, lookback)
  Parameters:
    high (float)
    low (float)
    close (float)
    volume (float)
    lookback (int)

getVolatilityRegime(src, bbLength, bbMult)
  Parameters:
    src (float)
    bbLength (int)
    bbMult (float)

getESConfirmation(spxClose, esClose, spxHigh, esHigh, spxLow, esLow, lookback)
  Parameters:
    spxClose (float)
    esClose (float)
    spxHigh (float)
    esHigh (float)
    spxLow (float)
    esLow (float)
    lookback (int)

getDeltaBias(src, adaptiveRef, esClose, spxClose)
  Parameters:
    src (float)
    adaptiveRef (float)
    esClose (float)
    spxClose (float)

getGammaZone(src, atmStrike)
  Parameters:
    src (float)
    atmStrike (int)

getVegaRegime(vixSymbol)
  Parameters:
    vixSymbol (simple string)

isFailState(volRegime, hour, minute, vix, atr)
  Parameters:
    volRegime (int)
    hour (int)
    minute (int)
    vix (float)
    atr (float)

checkCallConfluence(liquidityGrabLow, volRegime, esConfirmation, failState, deltaBias, lowGamma)
  Parameters:
    liquidityGrabLow (bool)
    volRegime (int)
    esConfirmation (int)
    failState (bool)
    deltaBias (int)
    lowGamma (bool)

checkPutConfluence(liquidityGrabHigh, volRegime, esConfirmation, failState, deltaBias, lowGamma)
  Parameters:
    liquidityGrabHigh (bool)
    volRegime (int)
    esConfirmation (int)
    failState (bool)
    deltaBias (int)
    lowGamma (bool)

checkProfitTarget(entryPrice, currentPrice, targetPercent, isCall)
  Parameters:
    entryPrice (float)
    currentPrice (float)
    targetPercent (float)
    isCall (bool)

checkStopLoss(entryPrice, currentPrice, stopPercent, isCall)
  Parameters:
    entryPrice (float)
    currentPrice (float)
    stopPercent (float)
    isCall (bool)

checkTimeExit(hour, minute)
  Parameters:
    hour (int)
    minute (int)

checkInvalidation(esConfirmation, isCallPosition)
  Parameters:
    esConfirmation (int)
    isCallPosition (bool)

Disclaimer

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.