NexusFi: Find Your Edge


Home Menu

 





Can someone please convert this indicator from tradingview to nt8


Discussion in NinjaTrader

Updated
    1. trending_up 2,168 views
    2. thumb_up 2 thanks given
    3. group 4 followers
    1. forum 2 posts
    2. attach_file 0 attachments




 
Search this Thread

Can someone please convert this indicator from tradingview to nt8

  #1 (permalink)
 Dinoraver 
Chicago Illinois
 
Experience: None
Platform: Ninjatrader
Trading: NQ futures
Posts: 2 since Mar 2022
Thanks Given: 0
Thanks Received: 0

Hello,

I have a chandelier exit that I love using as part of a strategy for tradingview. It plots slightly different on the tradingview indicator versus any of the nt8 versions I have found so if anyone could direct me where I could go to get the code translated I would greatly appreciate it.

Thank You

study("Chandelier Exit", shorttitle="CE", overlay=true)

length = input(title="ATR Period", type=input.integer, defval=22)
mult = input(title="ATR Multiplier", type=input.float, step=0.1, defval=3.0)
showLabels = input(title="Show Buy/Sell Labels ?", type=input.bool, defval=true)
useClose = input(title="Use Close Price for Extremums ?", type=input.bool, defval=true)
highlightState = input(title="Highlight State ?", type=input.bool, defval=true)

atr = mult * atr(length)

longStop = (useClose ? highest(close, length) : highest(length)) - atr
longStopPrev = nz(longStop[1], longStop)
longStop := close[1] > longStopPrev ? max(longStop, longStopPrev) : longStop

shortStop = (useClose ? lowest(close, length) : lowest(length)) + atr
shortStopPrev = nz(shortStop[1], shortStop)
shortStop := close[1] < shortStopPrev ? min(shortStop, shortStopPrev) : shortStop

var int dir = 1
dir := close > shortStopPrev ? 1 : close < longStopPrev ? -1 : dir

var color longColor = color.green
var color shortColor = color.red

longStopPlot = plot(dir == 1 ? longStop : na, title="Long Stop", style=plot.style_linebr, linewidth=2, color=longColor)
buySignal = dir == 1 and dir[1] == -1
plotshape(buySignal ? longStop : na, title="Long Stop Start", location=location.absolute, style=shape.circle, size=size.tiny, color=longColor, transp=0)
plotshape(buySignal and showLabels ? longStop : na, title="Buy Label", text="Buy", location=location.absolute, style=shape.labelup, size=size.tiny, color=longColor, textcolor=color.white, transp=0)

shortStopPlot = plot(dir == 1 ? na : shortStop, title="Short Stop", style=plot.style_linebr, linewidth=2, color=shortColor)
sellSignal = dir == -1 and dir[1] == 1
plotshape(sellSignal ? shortStop : na, title="Short Stop Start", location=location.absolute, style=shape.circle, size=size.tiny, color=shortColor, transp=0)
plotshape(sellSignal and showLabels ? shortStop : na, title="Sell Label", text="Sell", location=location.absolute, style=shape.labeldown, size=size.tiny, color=shortColor, textcolor=color.white, transp=0)

midPricePlot = plot(ohlc4, title="", style=plot.style_circles, linewidth=0, display=display.none, editable=false)

longFillColor = highlightState ? (dir == 1 ? longColor : na) : na
shortFillColor = highlightState ? (dir == -1 ? shortColor : na) : na
fill(midPricePlot, longStopPlot, title="Long State Filling", color=longFillColor)
fill(midPricePlot, shortStopPlot, title="Short State Filling", color=shortFillColor)

changeCond = dir != dir[1]
alertcondition(changeCond, title="Alert: CE Direction Change", message="Chandelier Exit has changed direction!")
alertcondition(buySignal, title="Alert: CE Buy", message="Chandelier Exit Buy!")
alertcondition(sellSignal, title="Alert: CE Sell", message="Chandelier Exit Sell!")

Started this thread Reply With Quote

Can you help answer these questions
from other members on NexusFi?
REcommedations for programming help
Sierra Chart
Cheap historycal L1 data for stocks
Stocks and ETFs
Trade idea based off three indicators.
Traders Hideout
MC PL editor upgrade
MultiCharts
ZombieSqueeze
Platforms and Indicators
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
What is Markets Chat (markets.chat) real-time trading ro …
77 thanks
Spoo-nalysis ES e-mini futures S&P 500
55 thanks
Just another trading journal: PA, Wyckoff & Trends
38 thanks
Bigger Wins or Fewer Losses?
24 thanks
The Program
17 thanks
  #2 (permalink)
 
Fat Tails's Avatar
 Fat Tails 
Berlin, Europe
Market Wizard
 
Experience: Advanced
Platform: NinjaTrader, MultiCharts
Broker: Interactive Brokers
Trading: Keyboard
Posts: 9,888 since Mar 2010
Thanks Given: 4,242
Thanks Received: 27,103

The Chandelier Stop can be calculated in different ways:

- Donchian anchor (highest high since N bars) versus highest high since in position
- Calculation from highest high / lowest low (standard) versus calculation from highest close / lowest close
- Calculation as trailing stop (no widening of stop allowed when volatility increases) versus stop that may widen
- Design to revert intra-bar when touched (such as a hard stop) or to revert based on the close

Best you post a simple 5-min or 15-min chart of ES 06-22 or NQ 06-22 with the Chandelier Stop applied.

That way it is possible to find out which version you are looking for.

Reply With Quote
Thanked by:
  #3 (permalink)
 
Anagami's Avatar
 Anagami 
Cancun, Mexico
Legendary Market Hustler
 
Experience: Advanced
Trading: MES
Posts: 978 since Dec 2010
Thanks Given: 707
Thanks Received: 2,300



Fat Tails View Post
The Chandelier Stop can be calculated in different ways:

- Donchian anchor (highest high since N bars) versus highest high since in position
- Calculation from highest high / lowest low (standard) versus calculation from highest close / lowest close
- Calculation as trailing stop (no widening of stop allowed when volatility increases) versus stop that may widen
- Design to revert intra-bar when touched (such as a hard stop) or to revert based on the close

Best you post a simple 5-min or 15-min chart of ES 06-22 or NQ 06-22 with the Chandelier Stop applied.

That way it is possible to find out which version you are looking for.

WHAT?? Harry is ALIVE?

You are never in the wrong place... but sometimes you are in the right place looking at things in the wrong way.
Reply With Quote
Thanked by:




Last Updated on May 16, 2022


© 2024 NexusFi™, s.a., All Rights Reserved.
Av Ricardo J. Alfaro, Century Tower, Panama City, Panama, Ph: +507 833-9432 (Panama and Intl), +1 888-312-3001 (USA and Canada)
All information is for educational use only and is not investment advice. There is a substantial risk of loss in trading commodity futures, stocks, options and foreign exchange products. Past performance is not indicative of future results.
About Us - Contact Us - Site Rules, Acceptable Use, and Terms and Conditions - Privacy Policy - Downloads - Top
no new posts