NexusFi: Find Your Edge


Home Menu

 





Conversion of TradingView indicator into NT8


Discussion in NinjaTrader

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




 
Search this Thread
  #1 (permalink)
 Abusamjad91 
San Francisco California
 
Experience: None
Platform: NinjaTrader
Trading: futures
Posts: 76 since Oct 2020
Thanks Given: 57
Thanks Received: 60

Hello NexusFi,

Can someone convert this TradingView indicator into NT8?

//@version=3
study("Blended Candles")
theEMA = input(50)
theEMA2 = input(200)
lb = input(3,title = "Lookback")
out = ema(close, theEMA)
out2 = ema(close, theEMA2)
hc = highest(high,lb + 1)
oc = open[lb]
cc = close
lc = lowest(low,lb + 1)

plot(out, color=red,linewidth=2,transp=30)
plot(out2, color=green,linewidth=2,transp=30)
plotcandle(oc, hc, lc, cc, color = oc < cc ? green : red , wickcolor = white , bordercolor = white)


Attached Thumbnails
Click image for larger version

Name:	blended.png
Views:	252
Size:	51.2 KB
ID:	328090  
Started this thread Reply With Quote

Can you help answer these questions
from other members on NexusFi?
My Rant with AMP Futures
Trading Reviews and Vendors
No book, only a stair: journaling fills where price move …
Cryptocurrency
What we know about Binances $6.3bn hack - BBC News
Cryptocurrency
Building a free browser DOM/SMC simulator - need some ad …
Platforms and Indicators
requesting .nrd replay files from 2026 spy and qqq
The Elite Circle
 
  #2 (permalink)
 
Tasker_182's Avatar
 Tasker_182 
Cedar Rapids, iowa
Legendary Market Wizard
 
Experience: Intermediate
Platform: Ninjatrader
Broker: Ninjatrader - Continuum
Posts: 716 since Aug 2009
Thanks Given: 476
Thanks Received: 1,406


Abusamjad91 View Post
Hello NexusFi,

Can someone convert this TradingView indicator into NT8?

//@version=3
study("Blended Candles")
theEMA = input(50)
theEMA2 = input(200)
lb = input(3,title = "Lookback")
out = ema(close, theEMA)
out2 = ema(close, theEMA2)
hc = highest(high,lb + 1)
oc = open[lb]
cc = close
lc = lowest(low,lb + 1)

plot(out, color=red,linewidth=2,transp=30)
plot(out2, color=green,linewidth=2,transp=30)
plotcandle(oc, hc, lc, cc, color = oc < cc ? green : red , wickcolor = white , bordercolor = white)


I'm not familiar with TradingView code so I took a stab at this. As near as i can tell the indicator does not use the values of either of the EMAs in the bar calculations so I left those off. You can easily add EMAs to the chart in NinjaTrader.

In calculating the candles I'm understanding (I think) that:
1) Close of the candle is the real close of the source candle so no changes there.
2) The Open of the candle is from the Candle from the lookback period (default is 3 so for discussion we can assume we use the Open price of the 3rd candle back, whatever it may be)
3) The High is determined as the maximum high value over the lookback period plus 1
4) The Low is determined as the minimum low value of the lookback period plus 1.

Those 4 values then are used to create and color each candle.

To be clear these candle representations DO NOT correctly show actual price.

I've attached a screenshot that shows the indicator applied with default values to a ES 1 minute bar series, below that is a copy of the original 1 minute bars which clearly show no relationship. The screenshot also shows the two EMAs manually added.

I hope this is what you need.




Screenshot_20221117_040813


Be yourself; everyone else is already taken. Oscar Wilde
Attached Files
Elite Membership required to download: BlendedCandles.cs
Reply With Quote
Thanked by:
  #3 (permalink)
 Abusamjad91 
San Francisco California
 
Experience: None
Platform: NinjaTrader
Trading: futures
Posts: 76 since Oct 2020
Thanks Given: 57
Thanks Received: 60


Thank you @ Tasker_182. Your work is much appreciated! This is what I was looking for.


Started this thread Reply With Quote
Thanked by:




Last Updated on November 17, 2022


© 2026 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 - Downloads - Top
no new posts