Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Easy way to exclude holidays?

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

    Easy way to exclude holidays?

    I've noticed that when I run a strategy over the past three years it trades on more days than there actually were. This is because my strategy does not know how to tell whether or not the day is a holiday or some other shortened trading day.

    Is there a way to prevent trading on these days?

    And also is there a way to remove the data from these days?

    My strategy relies on gathering data from the prior day and I would like to test the differences between leaving this data in there and taking it out.

    --------------------------
    On a separate note, is there any way to perform a different trade in the same market when an automatic strategy is trading?

    Or is having multiple trading accounts the only way this can be done? If so will this change in NT7?

    #2
    Hello Shazzmoe,

    Thank you for your post.

    You can prevent trading for these days, but you would have to hardcode the specific days, and of course the specific day can change from year to year.

    To check against a specific day you could use the snippet below:

    Code:
    [FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff]if[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][FONT=Courier New][SIZE=2] (ToDay(Time[[/SIZE][/FONT][/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#800080][FONT=Courier New][SIZE=2][COLOR=#800080][FONT=Courier New][SIZE=2][COLOR=#800080]0[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][FONT=Courier New][SIZE=2]]) != [/SIZE][/FONT][/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#800080][FONT=Courier New][SIZE=2][COLOR=#800080][FONT=Courier New][SIZE=2][COLOR=#800080]20091225[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][FONT=Courier New][SIZE=2])[/SIZE][/FONT]
    [SIZE=2][FONT=Courier New]{[/FONT][/SIZE]
    [/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#008000][FONT=Courier New][SIZE=2][COLOR=#008000][FONT=Courier New][SIZE=2][COLOR=#008000]//make trades[/COLOR][/SIZE][/FONT]
    [/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][FONT=Courier New][SIZE=2]}[/SIZE][/FONT]
    [/SIZE][/FONT]
    That says make trades as long as the date isn’t 12-25-2009. You can use && operator and duplicate the first half of the expression to exclude multiple days.

    You can delete the data by going to Tools > Historical Data > Delete

    You can make separate trades from your automated strategy in the same market. However the overall account position will reflect orders placed using both methods. If you want them separate you would have to create a second sim account and this can only be done with a live license. We don’t anticipate this changing in version 7.
    Ryan M.NinjaTrader Customer Service

    Comment


      #3
      Originally posted by NinjaTrader_RyanM View Post
      You can make separate trades from your automated strategy in the same market. However the overall account position will reflect orders placed using both methods. If you want them separate you would have to create a second sim account and this can only be done with a live license. We don’t anticipate this changing in version 7.

      Thank you for all the helpful info. I do have a live trading account which I trade from regularly. How do I set up this second "sim" account in order to execute one trade from a strategy and another one manually in the same market. And will these trades be tied to the same physical account?

      Comment


        #4
        You can create additional sim accounts. Click on Tools > Options > Simulator tab. Click Accounts, type in a new account name and click save. This account will then be available to you in your order entry screens.

        You can run a strategy on one account and place manual trades on the other.

        These accounts are separate and will have separate performance history depending on trades placed in each.
        Ryan M.NinjaTrader Customer Service

        Comment


          #5
          Sorry I think my question has been misunderstood. I want to Live Trade the same market with my real account.

          For example, my automatic strategy is running on my live account, it takes a trade.

          Normally at this point I am unable to take a manual trade until that trade is finished.

          Comment


            #6
            You can have your strategy running and place manual orders.

            Your net position will be reflective of both strategy generated orders and manual orders.

            Ex: Your strategy places you in a trade and you're long 1. You can open up a Superdom window and place an order for Short 1. The strategy doesn't know about the Superdom and the Superdom doesn't know about the strategy. Your net position will be flat but each order entry screen will indicate the position according to activity in their realm.
            Ryan M.NinjaTrader Customer Service

            Comment


              #7
              Originally posted by NinjaTrader_RyanM View Post
              You can have your strategy running and place manual orders.

              Your net position will be reflective of both strategy generated orders and manual orders.

              Ex: Your strategy places you in a trade and you're long 1. You can open up a Superdom window and place an order for Short 1. The strategy doesn't know about the Superdom and the Superdom doesn't know about the strategy. Your net position will be flat but each order entry screen will indicate the position according to activity in their realm.

              So you're saying that even though the posistions tab says im has nothing active and my realized amount is updated and the dom says I'm flat I might actually just be in two orders or oposite directions?

              I've been testing this out over and over but it seems like everytime i place an order on the dom it messes with my strategy.

              Say my automated strategy shorts for 5 points. The market starts to fall and i have an order waiting to go long 3 points below that short entry.

              Everytime I simulate this (and the one time this happened to me live trading) it appears to simply exit the short entry at that three points profit but throws up the stop/target for that atm. So now I appear to be flat but have 4 pendings orders at various prices.

              I thought maybe it was just displaying incorrectly but if i let it hit the original 5 point target for the short entry i am then long at the point i wanted to exit the market and after the market plays out as expected i realise that my two trades have lost money when they should have made money

              Comment


                #8
                shazzmoe, your analysis is correct. It will "appear" to exit the short entry and you will have a net flat position, but that "flat" position will have two target orders and two stop orders associated with it. If all those stops/targets are filled, then the position will be flat again.

                Depending on the stops and targets of both positions, the net P/L could be positive or negative.
                AustinNinjaTrader Customer Service

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by ursavent, Today, 12:54 PM
                0 responses
                2 views
                0 likes
                Last Post ursavent  
                Started by Mizzouman1, Today, 07:35 AM
                3 responses
                17 views
                0 likes
                Last Post NinjaTrader_Gaby  
                Started by RubenCazorla, Today, 09:07 AM
                2 responses
                13 views
                0 likes
                Last Post NinjaTrader_ChelseaB  
                Started by i019945nj, 12-14-2023, 06:41 AM
                7 responses
                82 views
                0 likes
                Last Post NinjaTrader_ChelseaB  
                Started by timmbbo, 07-05-2023, 10:21 PM
                4 responses
                158 views
                0 likes
                Last Post NinjaTrader_Gaby  
                Working...
                X