Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

Partner 728x90

Collapse

Simulating a longer time frame with a shorter one

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

    Simulating a longer time frame with a shorter one

    Hey guys,

    So, if I understand this correctly, the three base data sizes for construction of Bars objects are the tick, minute, and day. If you add a 10-minute dataseries to a chart, then, internally it is constructing each of those 10-minute bars from ten 1-minute bars. Is it possible to do this construction by hand, in an indicator?

    For instance, I'm trying to make an indicator that could be applied to a "close of 1 minute" input series, and the plot that displayed would be exactly the same as plotting a "close of 10 minutes" series (as a line, not the candlestick). I know you could just add a 10-minute dataseries to the indicator internally to achieve this, but that's not what I'm after.

    It should be possible to construct the "close of 10 minutes" series by hand, by picking off the closing value of every tenth 1-minute bar, and then setting the plot value to that. I think the problem I'm running into is that the plot is synchronized to the input series, so it expects a new bar value every 1 minute, instead of every 10 minutes.

    Is there anything that can be done with the timing/synchronization of the plot, and when it expects a new value?

    Any help or advice would be greatly appreciated!

    thanks,
    FishBowl

    #2
    Hi FishBowl,

    Adding the 10 minute series to the to script (or adding a 1 minute series to the script and choosing every 10th bar) would be the supported way to do this.

    It is not supported to do so, but it is possible to request data from a script that is not synced.

    An example of this is in the Pivots indicator. To view this click Tools -> Edit NinjaScript -> Indicator... -> select Pivots -> click OK.

    On lines 104 to 115 and 318 to 329 you will find where this is done.

    Other than this there really isn't any other way that I am aware of.
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Originally posted by FishBowl View Post
      Hey guys,

      So, if I understand this correctly, the three base data sizes for construction of Bars objects are the tick, minute, and day. If you add a 10-minute dataseries to a chart, then, internally it is constructing each of those 10-minute bars from ten 1-minute bars. Is it possible to do this construction by hand, in an indicator?

      For instance, I'm trying to make an indicator that could be applied to a "close of 1 minute" input series, and the plot that displayed would be exactly the same as plotting a "close of 10 minutes" series (as a line, not the candlestick). I know you could just add a 10-minute dataseries to the indicator internally to achieve this, but that's not what I'm after.

      It should be possible to construct the "close of 10 minutes" series by hand, by picking off the closing value of every tenth 1-minute bar, and then setting the plot value to that. I think the problem I'm running into is that the plot is synchronized to the input series, so it expects a new bar value every 1 minute, instead of every 10 minutes.

      Is there anything that can be done with the timing/synchronization of the plot, and when it expects a new value?

      Any help or advice would be greatly appreciated!

      thanks,
      FishBowl
      You will have to use a Custom Plot() to do that, in exactly the manner that you have described. Easiest will be to use a GraphicsPath() and DrawPath(), but you could use NT's DrawLine() too.

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by wzgy0920, 04-20-2024, 06:09 PM
      2 responses
      26 views
      0 likes
      Last Post wzgy0920  
      Started by wzgy0920, 02-22-2024, 01:11 AM
      5 responses
      32 views
      0 likes
      Last Post wzgy0920  
      Started by wzgy0920, Yesterday, 09:53 PM
      2 responses
      49 views
      0 likes
      Last Post wzgy0920  
      Started by Kensonprib, 04-28-2021, 10:11 AM
      5 responses
      192 views
      0 likes
      Last Post Hasadafa  
      Started by GussJ, 03-04-2020, 03:11 PM
      11 responses
      3,234 views
      0 likes
      Last Post xiinteractive  
      Working...
      X