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

Strategy Using Readings From Both RTH and ETH Sessions for ES

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

    Strategy Using Readings From Both RTH and ETH Sessions for ES

    Hello!, I am new to NT8 but not new to trading. Have coding experience, but wouldn't consider myself an expert. Forgive me if an answer has been posted about this topic already. I've searched extensively and am still in need of direction. My question is as follows:

    I have a strategy ready to program. However, I am stuck on how to best incorporate a moving average value from an RTH session (the pit session) into a strategy that mainly uses values from an ETH session (the 24hr session).

    For example, most of my conditions are calculated from an ETH session chart, but I also need to somehow incorporate a reading such as, "is the close price above the 50 sma" from the RTH session.

    What's the best way to accomplish putting these together into a final strategy?

    Thanks!
    john

    #2
    hello bootize , this link https://ninjatrader.com/support/foru...urs-on-futures

    Comment


      #3
      Hello bootize,

      Thanks for your first post on the NinjaTrader forums and welcome!

      This would be possible but only in a Ninjascript created strategy (Cannot be done using the strategy builder).

      Basically you would use AddDataSeries() overload that allows you to specify the trading hours template where you would specify the name of the RTH template. Reference: https://ninjatrader.com/support/help...dataseries.htm

      For example, to add a 1 minute series based on the CME US Index Futures RTH template:
      AddDataSeries(null, new BarsPeriod() {BarsPeriodType = BarsPeriodType.Minute, Value = 1}, "CME US Index Futures RTH");

      You would also create a private instance of a moving average, for example: private SMA rthSMA; // my private SMA called rthSMA

      In State.DataLoaded, you would assign the SMA with the added data series to the private instance, for example: rthSMA = SMA(BarsArray[1], 20); // 20 period SMA based on added data series

      In the OnBarUpdate() you would access the private SMA when needed with rthSMA[0]. Note: You would need to code a time filter here so that you do not access the SMA value unless you are actually in Regular trading hours.
      Last edited by NinjaTrader_PaulH; 08-09-2019, 07:36 AM. Reason: Added welcome for first post user.
      Paul H.NinjaTrader Customer Service

      Comment


        #4
        Thanks Paul! Now I have a direction to work with.

        Much appreciation.

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by sidlercom80, 10-28-2023, 08:49 AM
        171 responses
        2,273 views
        0 likes
        Last Post QuantKey_Bruce  
        Started by Irukandji, Yesterday, 02:53 AM
        2 responses
        17 views
        0 likes
        Last Post Irukandji  
        Started by adeelshahzad, Today, 03:54 AM
        0 responses
        3 views
        0 likes
        Last Post adeelshahzad  
        Started by CortexZenUSA, Today, 12:53 AM
        0 responses
        3 views
        0 likes
        Last Post CortexZenUSA  
        Started by CortexZenUSA, Today, 12:46 AM
        0 responses
        1 view
        0 likes
        Last Post CortexZenUSA  
        Working...
        X