Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Time Setting ?

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

    Time Setting ?

    Hello,

    I'm new to Automated Trading and I'm trying to learn.

    I have a time question.

    Can I run 1 Indicator on one time zone and another on a different one ?

    for example MACD on 30 min and SMA on 5 min in NinjaScript strategy ?

    2nd question

    any tutorial I should watch or read to help with NinjaScript ?
    at the moment I'm using the wizard.

    Thank you for any suggestions.

    #2
    Hello n44x,

    Thank you for your post.

    On your first question are you asking if you can run two indicators within the strategy based on two time intervals (for example MACD on 30 min and SMA on 5) or those two indicators based on time time zones, such as Eastern and Central Time?

    On your second question we recommend our Automated Strategy Development webinar and our Learn NinjaScript video.
    There are a few Sample Automated Strategies which come pre-configured in NinjaTrader that you can use as a starting point. These are found under Tools--> Edit NinjaScript--> Strategy. You will see locked strategies where you can see the details of the code, but you will not be able to edit (you can though always create copies you can later edit via right click > Save as)

    We also have some Reference samples online as well as ‘Tips and Tricks’ for both indicators and strategies:
    These samples can be downloaded, installed and modified from NinjaTrader and hopefully serve as a good base for your custom works.

    If you have never created a strategy before, I would recommend starting with our point and click interface Strategy Wizard.
    Information on the Strategy Wizard can be found at the following link: http://www.ninjatrader.com/support/h...egy_wizard.htm

    I look forward to assisting you further.

    Comment


      #3
      Thanks answering,, I have alots to learn.

      when I said "time zone" I meant intervals

      I'm running Ninja Script at 5 min intervals, SMA is take data from that but I would like to take MACD data from 30 min intervals.

      I'm not sure if I'm explaining it right.

      thanks for the help and I will starting reading

      Comment


        #4
        Hello n44x,

        Thank you for your response.

        You would need to add a secondary bar series to the strategy and then use that secondary bar series for the MACD.

        For example:
        Code:
        protected override void Initialize()
        {
            // Add a 30 minute Bars object - BarsArray index = 1 
            Add(PeriodType.Minute, 30);
        }
        protected override voide OnBarUpdate()
        {
          if(BarsInProgress == 0)
          {
            if(MACD(BarsArray[1], 12, 26, 9)[0] > userVariable && SMA(20)[0] > userVariable2)
              {
                  // Do something
              }
          }
        }
        Here you can see the use of the BarsArray index of 1, for information on BarsArray please visit the following link: http://www.ninjatrader.com/support/h.../barsarray.htm

        For information on using multiple instrument and intervals in your NinjaScript code please visit the following link: http://www.ninjatrader.com/support/h...nstruments.htm

        Please let me know if I may be of further assistance.

        Comment


          #5
          Thank you for the help !

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by ScottWalsh, Today, 04:52 PM
          0 responses
          3 views
          0 likes
          Last Post ScottWalsh  
          Started by ScottWalsh, Today, 04:29 PM
          0 responses
          6 views
          0 likes
          Last Post ScottWalsh  
          Started by rtwave, 04-12-2024, 09:30 AM
          2 responses
          22 views
          0 likes
          Last Post rtwave
          by rtwave
           
          Started by tsantospinto, 04-12-2024, 07:04 PM
          5 responses
          70 views
          0 likes
          Last Post tsantospinto  
          Started by cre8able, Today, 03:20 PM
          0 responses
          7 views
          0 likes
          Last Post cre8able  
          Working...
          X