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 open ot day within intraday strategy

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

    Enter open ot day within intraday strategy

    Hi,

    1. I tried to enter at market on open of the day within a intraday strategy. Unfortunately with no success. Has anybody an idea?

    2. Next question ist to determine that only one entry per day is allowed.

    3. Is it possible to exit some seconds before the end of the session within a End of day strategy? With ExitOnClose it was not working.

    Thanks

    #2
    1. Please use filters of if (Bars.FirstBarOfSession && FirstTickOfBar) to place your order.

    2. You would keep track of this yourself.
    Code:
    if (Bars.FirstBarOfSession && FirstTickOfBar)
         hasTraded = false;
    
    if (hasTraded == false)
    {
         EnterLong();
         hasTraded = true;
    }
    3. Please use ExitOnClose. You need to set a reasonable amount of seconds before the market close for it to actually have time to submit and get filled by the exchange.
    Josh P.NinjaTrader Customer Service

    Comment


      #3
      Thanks for your quick answer, Josh. It tried it and it works at the second bar of the new day. Not bad but what about the open of the day? Is this also possible with intraday bars or do I have to change to daily bars?

      Comment


        #4
        You have to run in real-time with CalculateOnBarClose = false to get it to trade intrabar.
        Josh P.NinjaTrader Customer Service

        Comment


          #5
          Thanks. I will do so. But by the way:

          After deconnecting or closing down Ninjatrader the implemented strategies disapear allways. I saved the workspace but after every close down of NT I have to implement all the startegies again. How can I change it?

          Comment


            #6
            Closing NT will remove the strategy. NT7 will provide strategy persistence features.
            Josh P.NinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by FrazMann, Today, 11:21 AM
            0 responses
            3 views
            0 likes
            Last Post FrazMann  
            Started by geddyisodin, Yesterday, 05:20 AM
            8 responses
            52 views
            0 likes
            Last Post NinjaTrader_Gaby  
            Started by cmtjoancolmenero, Yesterday, 03:58 PM
            10 responses
            36 views
            0 likes
            Last Post NinjaTrader_ChelseaB  
            Started by DayTradingDEMON, Today, 09:28 AM
            4 responses
            24 views
            0 likes
            Last Post DayTradingDEMON  
            Started by George21, Today, 10:07 AM
            1 response
            19 views
            0 likes
            Last Post NinjaTrader_ChristopherJ  
            Working...
            X