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

Advice: MultiTimeFrame analysis, add higher time frame series or Global Variable

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

    Advice: MultiTimeFrame analysis, add higher time frame series or Global Variable

    Hi,

    I have a strategy that is based on very short term data and very useful because I paint the background and set an audio alert so no signals are missed while looking at another chart.

    The problem is it over trades in the sense that I typically prefer to trade in the direction of the higher trend.

    I switched from esignal and know javascript and python but just learning csharp and FWIW think it's the best language I've used a lot better than C++ and comparable to java although I don't know enough about either to have a real opinion.

    I realize secondary series can be loaded even in the strategy builder but because eSignal did not support MTF analysis I got used to setting global parameters in the higher time frame charts and think there are some advantages in terms of simplifying and perhaps modularizing the higher time frame logic.

    Can someone from support let me know if this is advisable and hopefully provide a few links to samples of each technique.

    Thank you very much
    Glen

    #2
    Hello demarcog,

    Thank you for your post.

    In the Strategy Builder, you could add a secondary data series in the Additional Data window of the Strategy Builder. Then, when creating conditions in the Conditions and Actions screen, you could set the Series to the added secondary series. For example, if you are comparing the Close of the added series to the Open of the added series in the Conditions and Actions window, you would select 'add' for Conditions, choose Close from the Price folder on the left side, then set the Series 1 property to the added secondary series. Similar steps would be done on the right side for the Open of the added series.

    See the SampleMultiTimeframe example script that comes with NinjaTrader for an example of working with multi-timeframe scripts. To view the code, open a New > NinjaScript Editor window, double click the Strategies folder, then select the SampleMultiTimeframe script.

    Also, see this help guide link - https://ninjatrader.com/support/help...nstruments.htm

    Creating global variables could be done by using static methods in an AddOn. Global variables would be used only if you need NinjaScripts to talk to each other since NinjaScripts by design should be standalone. That being said, if you are considering if you should use Multi-Timeframe or global variables, I suggest using Multi-Timeframe unless you need NinjaScripts to talk to each other.

    See this forum post for more information about static methods and an example - https://ninjatrader.com/support/foru...est#post733956

    Let us know if we may assist further.
    Brandon H.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by The_Sec, Today, 03:37 PM
    0 responses
    0 views
    0 likes
    Last Post The_Sec
    by The_Sec
     
    Started by GwFutures1988, Today, 02:48 PM
    1 response
    5 views
    0 likes
    Last Post NinjaTrader_Clayton  
    Started by ScottWalsh, 04-16-2024, 04:29 PM
    6 responses
    32 views
    0 likes
    Last Post ScottWalsh  
    Started by frankthearm, Today, 09:08 AM
    10 responses
    36 views
    0 likes
    Last Post frankthearm  
    Started by mmenigma, Today, 02:22 PM
    1 response
    4 views
    0 likes
    Last Post NinjaTrader_Jesse  
    Working...
    X