Does anyone know an easy or AI way to convert ThinkScript indicator to NinjaTrader? I have a simple gap finder TOS indicator I’d like to use with NinjaTrader. Gaps are super powerful. I can discuss their importance. Here’s the ThinkScript:
True Gap Indicator with Price Revisit Detection
Gap Up Condition
def gapUp = low > high[1];
Gap Down Condition
def gapDown = high < low[1];
Variables to Store Gap Levels
def gapUpPrice = if gapUp then high[1] else gapUpPrice[1];
def gapDownPrice = if gapDown then low[1] else gapDownPrice[1];
Gap Revisit Conditions
def gapUpRevisited = if gapUp then 0 else if low <= gapUpPrice then 1 else gapUpRevisited[1];
def gapDownRevisited = if gapDown then 0 else if high >= gapDownPrice then 1 else gapDownRevisited[1];
Plot Gap-Up Horizontal Line Until Revisit
plot gapUpLine = if !gapUpRevisited and !IsNaN(close) then gapUpPrice else Double.NaN;
gapUpLine.SetDefaultColor(Color.GREEN);
gapUpLine.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
Plot Gap-Down Horizontal Line Until Revisit
plot gapDownLine = if !gapDownRevisited and !IsNaN(close) then gapDownPrice else Double.NaN;
gapDownLine.SetDefaultColor(Color.RED);
gapDownLine.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
Visual Dots for Gaps
plot gapUpDot = if gapUp then low else Double.NaN;
gapUpDot.SetPaintingStrategy(PaintingStrategy.POINTS);
gapUpDot.SetDefaultColor(Color.GREEN);
gapUpDot.SetLineWeight(3);
plot gapDownDot = if gapDown then high else Double.NaN;
gapDownDot.SetPaintingStrategy(PaintingStrategy.POINTS);
gapDownDot.SetDefaultColor(Color.RED);
gapDownDot.SetLineWeight(3);
