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,632 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:	339
Size:	55.5 KB
ID:	291858  
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
requesting .nrd replay files from 2026 spy and qqq
The Elite Circle
Building a free browser DOM/SMC simulator - need some ad …
Platforms and Indicators
What we know about Binances $6.3bn hack - BBC News
Cryptocurrency
AI for Traders — Agents, Memory, Tools & Real-Worl …
Elite Quantitative GenAI/LLM
 
  #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