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

Missing a piece of the puzzle. (Referencing open of prior day)

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

    Missing a piece of the puzzle. (Referencing open of prior day)

    Hello and thank you for reading my post. I'm currently building and proving out a strategy that is working exactly as desired but I'm lacking in one area. The basics of my strategy are as follow.

    *Reference current day open.

    *If price crosses below the current day open price, open a short position. Vice versa for longs.

    What I'm wanting to add to this is I would like to reference not only the current day open price but also I want to compare that to the previous day's opening price. For example: If the current day's opening price is less than the prior day's open I want the strategy to only take shorts when crossing below the current day's opening price. Vice versa for longs. So my question is, how to I reference the prior day's opening price and compare it against the current day's opening price? I'm not by any means a coder so I'm trying to all of this within Builder and I've tried multiple ideas but have not been successful in my attempts. I did check out a few posts that were along the same vein and tried out those suggestions but I have had no success.

    I appreciate any and all feedback. Thank you

    Bmann

    #2
    Have you looked at the inbuilt indicator Prior day OHLC?
    Bruce DeVault
    QuantKey Trading Vendor Services
    NinjaTrader Ecosystem Vendor - QuantKey

    Comment


      #3
      Thanks for the reply. What I'm currently using in builder. Click image for larger version

Name:	NT.jpg
Views:	74
Size:	57.8 KB
ID:	1247301
      Last edited by Bmann777; 04-20-2023, 07:50 AM.

      Comment


        #4
        Hi Bmann777, thanks for posting. You can use the CurrentDayOHL/PriorDayOHLC indicators to calculate this so that your primary series does not need to be a daily series:

        Attached Files
        Chris L.NinjaTrader Customer Service

        Comment


          #5
          Thank you both for the input. Got it working. I never even noticed the Current day OHL. Thank you, thank you.

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by llanqui, Today, 09:59 AM
          1 response
          2 views
          0 likes
          Last Post NinjaTrader_Erick  
          Started by icebergdelphi, Today, 08:57 AM
          2 responses
          10 views
          0 likes
          Last Post icebergdelphi  
          Started by vitaly_p, Yesterday, 05:09 PM
          3 responses
          26 views
          0 likes
          Last Post NinjaTrader_Gaby  
          Started by llanqui, Yesterday, 12:51 PM
          4 responses
          12 views
          0 likes
          Last Post NinjaTrader_Jesse  
          Started by FAQtrader, 04-25-2024, 12:00 PM
          5 responses
          53 views
          0 likes
          Last Post NinjaTrader_ChelseaB  
          Working...
          X