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 knowmad, Today, 03:52 AM
            0 responses
            13 views
            0 likes
            Last Post knowmad
            by knowmad
             
            Started by tradingnasdaqprueba, Today, 03:42 AM
            0 responses
            8 views
            0 likes
            Last Post tradingnasdaqprueba  
            Started by Haiasi, 04-25-2024, 06:53 PM
            4 responses
            63 views
            0 likes
            Last Post effraenk  
            Started by ccbiasi, 11-23-2017, 06:06 AM
            5 responses
            2,205 views
            0 likes
            Last Post leodavis  
            Started by kujista, Yesterday, 12:39 AM
            2 responses
            14 views
            0 likes
            Last Post kujista
            by kujista
             
            Working...
            X