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

Retrieving multi-time frame information

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

    Retrieving multi-time frame information

    All,

    Noting Multi-time frame indicators are not currently possible (though scheduled for release in NT7), I have developed two indictors each operating in different time frames that I would like to combine in a multi-time frame strategy.

    The first indicator evaluates and returns the state of the trend in the market as Up (Value.Set (+1)), Down (Value.Set(-1)), or Neutral (Value.Set(0)). This indicator is run in a longer term chart. The second indicator evaluates and returns possible trade entry points as Entry (Value.Set(1)), or No entry (Value.Set(0)) based on the price action of a shorter term chart.

    My question is two-fold:
    1) The first indicator is displayed by changing the chart background colour. It is constructed with no plots or oscillators, yet the values -1, 0, or +1 (only required for feeding into the multi-time frame strategy) are plotted. Is it possible to stop the plotting of these values?
    2) Is using the "Value.Set" method in each indicator the best way to quickly combine these indicators in a strategy? Whereby both time frame Bar Objects would be added to the strategy and independently evaluated against their respective indictors.

    As always, all guidance is greatly appreciated.
    Shannon

    #2
    Hello,

    1) The first indicator is displayed by changing the chart background colour. It is constructed with no plots or oscillators, yet the values -1, 0, or +1 (only required for feeding into the multi-time frame strategy) are plotted. Is it possible to stop the plotting of these values?
    >>I would go into the original indicator and save it under a different name, then call this new name in your strategy. Take out the plotting in the new indicator. Also, don't add it to the Initialization block using Add().

    2) Is using the "Value.Set" method in each indicator the best way to quickly combine these indicators in a strategy? Whereby both time frame Bar Objects would be added to the strategy and independently evaluated against their respective indictors.
    >>I'd have to see your code to be sure, but you probably want to include them in the BarsInProgress blocks shown in this link:
    DenNinjaTrader Customer Service

    Comment


      #3
      Ben,

      Thanks for the quick reply.

      I may have misunderstood your response to the first question (below). At no stage is any plot line introduced in the initialisation block or anywhere else for that matter. As per your advice I saved the original indicator under a different name, the problem persists (I could not remove the Add() statement as it does not exist in the original script). I went as far as to copy the relevant code and paste it into a completely blank NinjaScript, the problem persists.

      At no stage is any plot introduced, yet a plot line appears in the chart price frame. By removing (commenting out) the lines of code where values are set (e.i. Value.Set (1); ) the plot line disappears from the chart. However, I require this indicator to have a Value so that it can feed into a broader strategy.

      While it is possible to duplicate the code and use one for display purposes (with the Value.Set () lines commented out), and one for feeding into the broader strategy, I do not see this as the best solution. To do so creates further potential for error.

      Again, any solutions are welcome.
      Shannon


      Originally posted by NinjaTrader_Ben View Post
      Hello,

      1) The first indicator is displayed by changing the chart background colour. It is constructed with no plots or oscillators, yet the values -1, 0, or +1 (only required for feeding into the multi-time frame strategy) are plotted. Is it possible to stop the plotting of these values?
      >>I would go into the original indicator and save it under a different name, then call this new name in your strategy. Take out the plotting in the new indicator. Also, don't add it to the Initialization block using Add().

      Comment


        #4
        Hello,

        OK, I think I understand what you need now. Try reviewing this link on exposing a value:
        DenNinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by burtoninlondon, Today, 12:38 AM
        0 responses
        9 views
        0 likes
        Last Post burtoninlondon  
        Started by AaronKoRn, Yesterday, 09:49 PM
        0 responses
        14 views
        0 likes
        Last Post AaronKoRn  
        Started by carnitron, Yesterday, 08:42 PM
        0 responses
        11 views
        0 likes
        Last Post carnitron  
        Started by strategist007, Yesterday, 07:51 PM
        0 responses
        13 views
        0 likes
        Last Post strategist007  
        Started by StockTrader88, 03-06-2021, 08:58 AM
        44 responses
        3,983 views
        3 likes
        Last Post jhudas88  
        Working...
        X