NexusFi: Find Your Edge


Home Menu

 





Drawing a region from current Moving avg value to a certain number of bars back


Discussion in NinjaTrader

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




 
Search this Thread
  #1 (permalink)
 mavmoney 
boston usa
 
Experience: None
Posts: 6 since Mar 2019
Thanks Given: 0
Thanks Received: 1

Hello all,

I'm trying to wrap my mind around something that was easy to code in thinkscript, but is quite a challenge on ninjascript (ninjatrader 8).

I'm hoping you can help!

What I want to do is draw a cloud between two moving averages - but I only want it 50 bars back on the chart from the current bar - and I would like it to be a rectangular cloud just based on the current value of the moving avg.

I've attached an example from my think or swim chart.

Any help would be appreciated!


Attached Thumbnails
Click image for larger version

Name:	thinkscript example.png
Views:	301
Size:	55.5 KB
ID:	291858  
Started this thread Reply With Quote

Can you help answer these questions
from other members on NexusFi?
Hungary Called for Magyar at 97pct, Ending 16-Year Orban …
Prediction Markets & Event Contracts
Powell in 48 Hours: Word Markets Give 78% on Inflation, …
Prediction Markets & Event Contracts
Prediction Markets Expiry Day: Trump Eyes War Exit, $230 …
Prediction Markets & Event Contracts
Weekend Update: First Qatari LNG Transit Attempted -- IR …
Traders Hideout
Bookmap Global Plus Lifetime + Lifetime Addons For Sale
Platforms and Indicators
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Sober Journey With S&P
24 thanks
2026 Jlab journal
10 thanks
Lady Vols Primer: Trading Volatility Journal
7 thanks
Algo automated / semi-automated trading anyone?
6 thanks
Trying to learn Volume and price action correlation
5 thanks
  #3 (permalink)
Medge91
london ontario
 
Posts: 25 since Jul 2015
Thanks Given: 6
Thanks Received: 11


I am brand new to programming on NT8, but have had some minor successes. Not sure what specific problems you are having, but a region in NT8 will span all the bars. I think you want to draw a rectangle instead.

Maybe try using Draw.Rectangle ()
It lets you specify how many bars back


Good Luck,
Edge


Reply With Quote
  #4 (permalink)
 mavmoney 
boston usa
 
Experience: None
Posts: 6 since Mar 2019
Thanks Given: 0
Thanks Received: 1

Thank you Medge91!

That simple suggestion has gotten me so much closer to where I want to be!
Simply a Breakthrough.


Started this thread Reply With Quote




Last Updated on March 28, 2020


© 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