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

Enter long if is over opening day

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

    Enter long if is over opening day

    Hello,

    I have any variables in my strategy analyzer and I want to launch my orders when the price will be over the opening day price (9.00h). I am doing it in DAX30.

    Thanks.

    #2
    Hello Ufesa,

    Thank you for your note.

    You may utilize a CrossAbove() condition in your strategy's OnBarUpdate() that checks the Close Price of the last bar against the Current Day's Open Price. I've provided a brief sample below:

    protected override void OnBarUpdate()

    {
    if (CrossAbove(Close[0], CurrentDayOHL().Open, 1))

    EnterLong();
    }

    Please see the following link to the CrossAbove() section on our Help Guide: http://ninjatrader.com/support/helpG...crossabove.htm

    Please let us know if we may provide further assistance.

    Comment


      #3
      Thanks. It's OK.

      I have another question. My system analyzer is in 5 min but I want to launch my orders when the price is higher that a EMA diary. Is it possible?

      Comment


        #4
        Hello Ufesa,

        May I please ask you to clarify what you mean by "EMA diary"? Are you referring to a condition that checks if the price is higher than a daily EMA?

        I look forward to your reply.

        Comment


          #5
          Yes. A daily EMA althoug my orders are in 5 min.

          Comment


            #6
            Hello Ufesa,

            Thanks for your reply.

            Yes, you can reference an EMA based on daily bars. You would need to add daily bars to your strategy and then recode your strategy to references the added daily series.

            You would add a data series by using the add() method: http://ninjatrader.com/support/helpG...e.htm?add3.htm

            In your OnbarUpdate() you would reference the daily bars, for example:

            if (Close[0] > EMA(Closes[1], 13)[0]) // if the close of the 5 minute bar is greater than the 13 period EMA of the daily bars (represented by Closes[1]).

            Programming a multi-time frame script has a number of considerations that we recommend you review the helpguide section here: http://ninjatrader.com/support/helpG...nstruments.htm
            Paul H.NinjaTrader Customer Service

            Comment


              #7
              And do it without typing the code? I use the edit strategy.

              Comment


                #8
                Hello Ufesa,

                Thanks for your reply.

                No, you would not be able to create a multi time frame strategy in the strategy wizard. The strategy would need to be created in ninjascript following the helpguide link previously provided.

                If you would like your strategy created for you, we can provide references to 3rd party ninjascript coders who could provide that service.
                Paul H.NinjaTrader Customer Service

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by swestendorf, Today, 11:14 AM
                2 responses
                5 views
                0 likes
                Last Post NinjaTrader_Kimberly  
                Started by xiinteractive, 04-09-2024, 08:08 AM
                4 responses
                13 views
                0 likes
                Last Post xiinteractive  
                Started by Mupulen, Today, 11:26 AM
                0 responses
                2 views
                0 likes
                Last Post Mupulen
                by Mupulen
                 
                Started by Sparkyboy, Today, 10:57 AM
                1 response
                5 views
                0 likes
                Last Post NinjaTrader_Jesse  
                Started by TheMarlin801, 10-13-2020, 01:40 AM
                21 responses
                3,917 views
                0 likes
                Last Post Bidder
                by Bidder
                 
                Working...
                X