Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Data Series, Beginner Question.

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

    Data Series, Beginner Question.

    New to working with NT. I had a question that I assume there is a very simple answer to, but I am unable to figure out. I am creating a strategy that trades on 30 min. bars. However, I want to add an EMA rule based on daily data, such as only go long when the 14 day EMA is above the 50 day EMA. I am having troubles getting this rule to work, since the indicator defaults to the data series being used in the strategy developer and charting, i.e. the 30 minute bars. There has to be an easy answer I am missing. Thanks.

    #2
    Originally posted by thebluescout View Post
    New to working with NT. I had a question that I assume there is a very simple answer to, but I am unable to figure out. I am creating a strategy that trades on 30 min. bars. However, I want to add an EMA rule based on daily data, such as only go long when the 14 day EMA is above the 50 day EMA. I am having troubles getting this rule to work, since the indicator defaults to the data series being used in the strategy developer and charting, i.e. the 30 minute bars. There has to be an easy answer I am missing. Thanks.
    You need to create a multi-timeframe script. Add the Weekly timeframe and make the necessary calculations. It is all in the NT help manual, and there is a an example shipped with NT. You will find the example in the Strategy folder when you try to edit a stategy.

    Comment


      #3
      Hello thebluescout,

      Thank you for your post.

      You will need to add an additional time frame to the code and then use BarsArray as the Input Series of the Indicator. For example:
      Code:
      Add(PeriodType.Day, 1);
      ...
      if(EMA(BarsArray[1], 14)[0] > EMA(BarsArray[1], 50)[0])
      {
      // Do something.
      }
      The example Koganam refers to is under Tools > Edit NinjaScript > Strategies > SampleMultiTimeFrame. You can find information on multiple time frames and instruments in your code at the following link: http://www.ninjatrader.com/support/h...nstruments.htm

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by agclub, Yesterday, 08:57 PM
      2 responses
      16 views
      0 likes
      Last Post agclub
      by agclub
       
      Started by cre8able, 04-17-2024, 04:16 PM
      6 responses
      55 views
      0 likes
      Last Post cre8able  
      Started by Mindset, 05-06-2023, 09:03 PM
      13 responses
      293 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Started by kaywai, 09-01-2023, 08:44 PM
      4 responses
      600 views
      0 likes
      Last Post joselube001  
      Started by dpolyakov, 03-29-2024, 11:30 AM
      3 responses
      135 views
      2 likes
      Last Post sonia0101  
      Working...
      X