• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

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 Darringona, Today, 07:43 AM
    0 responses
    3 views
    0 likes
    Last Post Darringona  
    Started by simonkloot, Today, 07:28 AM
    0 responses
    6 views
    0 likes
    Last Post simonkloot  
    Started by marcus2300, Today, 06:24 AM
    0 responses
    4 views
    0 likes
    Last Post marcus2300  
    Started by Dhjesus, Today, 06:23 AM
    0 responses
    7 views
    0 likes
    Last Post Dhjesus
    by Dhjesus
     
    Started by embreyw, Today, 05:56 AM
    0 responses
    6 views
    0 likes
    Last Post embreyw
    by embreyw
     
    Working...
    X