Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Add Period Types and Performance Hit

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

    Add Period Types and Performance Hit

    I do not know what is causing this and it could be an isolated case but i am finding that some strategies that contain multiple Period Types that are not assigned to a particular indicator or bar object (close,open,etc) can severely slow down an optimization. Its noticeable as only a few of the available cores will be used in this case.

    Example would be

    Optimize Bar Type: Minute, 1

    Add(PeriodType.Minute,2) // index 1
    Add(PeriodType.Minute,5) // index 2
    Add(PeriodType.Minute,15) // index 3

    Within the strategy the only components that reference the 0 index are SubmitOrder( "0" <----submitted against 1 min bar....and then all indicators are running on the 15 min period type.

    I was able to get around this problem by changing the 2 middle period types to 30 min and 45 min each. Which no indicators run on.

    I dont know why this fixed it but i didnt want to delete them or i would have to change the barsArray[3] to barsarray[1]....Also this has never happened before and for backtesting to realtime trading i like to keep extra bar types accessible. like adding the first bar type as periodtype.minute,1 -- even though the base chart is always one minute as then when i switch to ticks its much more user friendly coding.

    Any idea on why this would slow down optimizations, or disable use of all cores?

    #2
    Hi Ben, thanks for the report - we will look into it - do you find this only in the unmanaged mode?
    BertrandNinjaTrader Customer Service

    Comment


      #3
      Well i only use unmanaged so i cant say for sure.

      It honestly seems like sometimes code can somehow stay active even when deleted, i know that sounds crazy but if i move code around or delete entire lines by moving the code from single statements per line to multiple commands per line....such and such; such and such;

      versus

      such and such;
      such and such;

      it can fix some of these strange issues.

      This usually happens when i start with a strategy that maxes out the number of available parameters (kind of a neural network data mining strategy i built) and then reduce the number of indicators along the way. As i remark out code it seems some of the code will stay active even when remarked out...Or maybe not stay active, but not entirely be deleted either. I know this likely is impossible. But i have tried everything i can think of to fix this issue otherwise.

      Comment


        #4
        Hi Ben, I see and know you were dealing with similar issues a while ago as well - so basically you change / comment code and then rerun the strategy in the SA and it would still work off an old instance of your code? I'm working on clarifying the performance questions you raised with development, those additional minute series should not have that noticeably an impact I would believe.
        BertrandNinjaTrader Customer Service

        Comment


          #5
          Yeah an example would be like, i typically set conditions like such cond1 = (Close > Close[1] ? 1:0);

          and then if (cond1 and cond2 and cond3)
          then entershort. If i delete or remark out the code to one of the conditions, both in the calculation and in the entry condition sometimes the code will stop working entirely until i uncomment then and then manually override them by switching the 1:0 in the cond1 statement to both 1:1 etc.

          This has been an issue from optimization through market replay.

          Comment


            #6
            I see, like a range of binary conditions / switches - I will play around with a script like this and attempt to reproduce your scenario - thanks for the input.
            BertrandNinjaTrader Customer Service

            Comment


              #7
              Correct. I sometimes will have 20 some conditions when i start and then end up with only a few active at the end of a sequence of tests. Somehow towards the end i sometimes - not always. Experience issues.

              I forgot that one thing i have done is copy the code into notepad and then copy it back, recompile and sometimes that fixes it. I kind of forgot about that fix in the last couple days as it doesnt always happen.

              Notepad would remove any type of formatting either apparent or hidden.......but who knows.

              Thanks Bertrand....Also if you can give the developers a little push on figuring out why we get the crash during market replay. Specifically the memory error. Scott B. and i typically experience this crash on a daily basis and we dont work in the same office nor use any of the same code.

              Thanks!

              BK

              Comment


                #8
                Thanks Ben, unfortunately haven't got a cleanly reproducible scenario figured out - correct the code formatting would be lost when copying for example from notepad or a similar editor.

                Can you please refresh my memory on the MR crash you're referring to?

                Thank you,
                BertrandNinjaTrader Customer Service

                Comment


                  #9
                  When running market replay i experience crashes quite often, and the error always says something about corrupt memory. Which i know is not the case as i run memtest quite often. Also i have the same crash on different machines. It typically happens when i set market replay to run on tick data for 5 months or so of data to check trades against WF test results to check if i have the code correct for real time.

                  Comment


                    #10
                    Ben, please contact me via Help > Mail to Support with your most recent trace / logs showing one of those and ask Scott please to do the same. Thanks and a good weekend.
                    BertrandNinjaTrader Customer Service

                    Comment

                    Latest Posts

                    Collapse

                    Topics Statistics Last Post
                    Started by junkone, Today, 11:37 AM
                    2 responses
                    14 views
                    0 likes
                    Last Post junkone
                    by junkone
                     
                    Started by frankthearm, Yesterday, 09:08 AM
                    12 responses
                    43 views
                    0 likes
                    Last Post NinjaTrader_Clayton  
                    Started by quantismo, 04-17-2024, 05:13 PM
                    5 responses
                    35 views
                    0 likes
                    Last Post NinjaTrader_Gaby  
                    Started by proptrade13, Today, 11:06 AM
                    1 response
                    7 views
                    0 likes
                    Last Post NinjaTrader_Clayton  
                    Started by love2code2trade, 04-17-2024, 01:45 PM
                    4 responses
                    35 views
                    0 likes
                    Last Post love2code2trade  
                    Working...
                    X