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:	78
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 kevinenergy, 02-17-2023, 12:42 PM
          122 responses
          2,878 views
          1 like
          Last Post Lancer
          by Lancer
           
          Started by rayyyu12, Today, 03:59 PM
          0 responses
          5 views
          0 likes
          Last Post rayyyu12  
          Started by calmcosmia, Today, 03:07 PM
          4 responses
          13 views
          0 likes
          Last Post calmcosmia  
          Started by Tim-c, Today, 02:34 PM
          1 response
          7 views
          0 likes
          Last Post NinjaTrader_Jesse  
          Started by idangre, 12-08-2016, 11:37 AM
          11 responses
          1,285 views
          0 likes
          Last Post gkadokg
          by gkadokg
           
          Working...
          X