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,473 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:	318
Size:	55.5 KB
ID:	291858  
Started this thread Reply With Quote

Can you help answer these questions
from other members on NexusFi?
CFTC Opens First COT Report Review in 20 Years -- Asks W …
Traders Hideout
CME Group CEO Calls CFTC-Approved Crypto Perps Dangerous …
Traders Hideout
Memorandum Watch: How the 60-Day MOU Framework Makes May …
Prediction Markets & Event Contracts
Four New E-mini Futures Launch June 29 -- Russell 3000, …
Emini and Emicro Index
April FOMC Minutes: Most Divided Fed Since 1992 -- Many …
Traders Hideout
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
NexusFi site changelog and issues/problem reporting
8 thanks
Darmok and Jalad at Tanagra
3 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