Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Data from different time frame same instrument

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Data from different time frame same instrument

    Hi;
    I am trying to get the average daily range of an instrument and use the number in a calculation on an intraday time frame of the same instrument to then plot a line.

    I have:
    in variables - private DataSeries drange;
    in initialize - Add(PeriodType.Day, 1); but I don't know how to reference this to calculate the daily range then store it as a series.
    drange = new DataSeries(this);

    What do I do in OnBarUpdate to get the 20 day average range? - It only needs to be calculated at the start of the session and then remain constant till the next session but the rest of my indicator updates on each tick.

    I have tried something like

    double range = SMA(Drange, Rangeperiod);

    with various calculations before hand but nothing seems to give me my value - I then plan to use it for something like

    targetup = SessionOpen + range

    I obviously cant get it to plot - can anybody point me in the right direction please Kooganam/Sledge et al !!

    Thanks in advance.

    #2
    Hello StockTraderBmp,

    Thank you for your post.

    I have attached a sample script that will show you how to calculate the Range of the Daily DataSeries and then plot that value.

    You will need to download and import into NinjaTrader.

    To Import

    * Download the indicator to your desktop, keep them in the compressed .zip file.
    * From the Control Center window select the menu File> Utilities> Import NinjaScript
    * Select the downloaded .zip file
    * NinjaTrader will then confirm if the import has been successful.


    Critical - Specifically for some indicators, it will prompt that you are running newer versions of @SMA, @EMA, etc. and ask if you want to replace, press 'No'

    Let me know if I can be of further assistance.
    Attached Files
    Cal H.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Geovanny Suaza, 02-11-2026, 06:32 PM
    0 responses
    601 views
    0 likes
    Last Post Geovanny Suaza  
    Started by Geovanny Suaza, 02-11-2026, 05:51 PM
    0 responses
    347 views
    1 like
    Last Post Geovanny Suaza  
    Started by Mindset, 02-09-2026, 11:44 AM
    0 responses
    103 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by Geovanny Suaza, 02-02-2026, 12:30 PM
    0 responses
    559 views
    1 like
    Last Post Geovanny Suaza  
    Started by RFrosty, 01-28-2026, 06:49 PM
    0 responses
    558 views
    1 like
    Last Post RFrosty
    by RFrosty
     
    Working...
    X