Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Save each strategy with Session Start and end times.

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

    Save each strategy with Session Start and end times.

    This should be easy to add to version 6.5.

    Every time i load ninja, I have to set the session start and end times.

    Can strategies be set to allow them to remember session start and end times???

    or can they be set as a variable within the strategy itself?

    #2
    I know this is repetetive. I will see what can be done but there is no guarantee.
    RayNinjaTrader Customer Service

    Comment


      #3
      This is actually not officially supported but this will work if you are programming your strategies in the NinjaScript Editor. Add code like the following in your strategy's Initialize() method. This code would set session time from 7:30 AM to 2:15 PM.

      Code:
      [FONT=Courier New][SIZE=2]SessionBegin = [/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#0000ff]new[/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2] DateTime([/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#800080]1[/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2], [/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#800080]1[/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2], [/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#800080]1[/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2], [/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#800080]7[/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2], [/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#800080]30[/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2], [/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#800080]0[/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2]);
      SessionEnd = [/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#0000ff]new[/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2] DateTime([/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#800080]1[/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2], [/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#800080]1[/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2], [/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#800080]1[/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2], [/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#800080]14[/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2], [/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#800080]15[/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2], [/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#800080]0[/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2]); [/SIZE][/FONT]
      [FONT=Courier New][SIZE=2][/SIZE][/FONT]


      RayNinjaTrader Customer Service

      Comment


        #4
        I know it is kinda late to be seeing this reply, but i tested it in Ver 6.5, and it still takes the time set manually, not what is in the code.

        Comment


          #5
          richa61416, check it against the latest 6.5 beta (4 for me). Ray's recommendation worked; I just test it.

          Ray, thanks for the suggestion. Your suggestion makes me suspect that every property that can be specified in the backtest property window can be programmatically set in NS. For example, now I want to set the Data series type and value from the NS. Is there a way to do even this?

          -Henry

          Comment


            #6
            Unfortunatey I can't give you a hint for data series, this is not supported.
            RayNinjaTrader Customer Service

            Comment


              #7
              You are correct Henry. It does work. I was assuming that regardless of what time I place into the start and end, it would go with what was in the code. E.g. even if 12AM to 12AM was there, it would have used my times in the code.

              But, I see it sets it on the outside for me, so I don;t have to type it in.

              Ok. That is good.

              NOW. All I would really need is either that we can also set the time parameters, or Save Workspace remembers all the strategies that I have loaded, and also the setting for them. The latter would be more helpful.

              Comment


                #8
                Hey Ray, Please tell me in version 7 that we will be able to save a bunch of strategy details. As i trade more markets, I have more strategies to load daily. Some Tick, Some Range, Some Minute. Getting tiresome every day the same scenario. Would be nice if I could save them once I have loaded all, and retrieve them the next day. Please tell me I will see this in Fall for NT V7. (Providing I don't get tired and forget to place Minute option instead of Tick and blow my accounts due to setting one value wrong. hehehe)

                Comment


                  #9
                  We will make announcement on NT7 features as appropriate. Thanks for your suggestion though.

                  Comment

                  Latest Posts

                  Collapse

                  Topics Statistics Last Post
                  Started by Christopher_R, Today, 12:29 AM
                  0 responses
                  9 views
                  0 likes
                  Last Post Christopher_R  
                  Started by sidlercom80, 10-28-2023, 08:49 AM
                  166 responses
                  2,235 views
                  0 likes
                  Last Post sidlercom80  
                  Started by thread, Yesterday, 11:58 PM
                  0 responses
                  3 views
                  0 likes
                  Last Post thread
                  by thread
                   
                  Started by jclose, Yesterday, 09:37 PM
                  0 responses
                  8 views
                  0 likes
                  Last Post jclose
                  by jclose
                   
                  Started by WeyldFalcon, 08-07-2020, 06:13 AM
                  10 responses
                  1,415 views
                  0 likes
                  Last Post Traderontheroad  
                  Working...
                  X