Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Coding a strategy not to run based on parameters?

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

    #16
    Hey, I'm not trying to make enemies here...I just have a strategy with two variables that I want to act as follows:
    * when VAR2=10, I want to run over iterations of VAR2=10 and VAR1=1-9
    * when VAR2=9, I want to run over iterations of VAR2=9 and VAR1=1-8
    * when VAR2=8, I want to run over iterations of VAR2=8 and VAR1=1-7
    * when VAR2=7, I want to run over iterations of VAR2=7 and VAR1=1-6
    etc.

    In other words the iterations of VAR2=7 and VAR1=9 does not make sense given my strategy--that set of values will end up with NO trades being performed, so I want to skip over those iterations.


    Anyway, thanks again for trying to help...I do appreciate it. Actually this NT forum is really great...I've jsut recently started to take advantage of it. There are a lot of good people--both from NT and others--and I really do hope to continue to learn and contribute.

    Comment


      #17
      Baruch is right

      Not trying to take sides here - just an outsider chiming in - but if you'll take another look at his logic you will see that it makes sense. His way will cut your iterations by approximately 55%.

      Comment


        #18
        Ok cool, it does feel like I should be able to cut my iterations by around 50%/55%...it really feels like there should be a solution here, but for whatever reason every time I scratch down on a piece of paper an example setup of what I think should work..it doesn't.

        Can you elaborate on how you seeing it work?


        Here are the scenarios I've tried...remember my goal is:
        VAR1 = 1-9
        VAR2 = 1-10

        but only have it try the iterations where VAR2 > VAR1, i.e. when VAR2=10, try VAR1=1-9; when VAR2=9, try VAR1=1-8; etc.


        So I first tried:
        [#1]
        var1 1;9;1
        adder 1;9;1
        var2 = var1+adder

        {this doesn't work...consider the iteration of var1=2/adder=9, you end up with var2=11;var1=2. The exercise here is to avoid wrong iterations}


        [#2]
        I was thinking maybe if I could count backwards that might help:
        var2 10;1;-1
        diff 9;1;-1

        var1 = var2-adder

        {same outcome though...consider the iteration of var2=9/diff=9, you end up with var2=9; var1=0 -- that's not one of the acceptable pairings}


        jh1962: thanks for chiming in...I really do appreciate it--I think it's so cool that we have a forum like this where we can collectivly try to solve stupid little problems like this. If you have any ideas on how to make this work, I'd greatly appreciate it.

        Just to give everone some context...the reason I need/want variables like this to optimize over is these two variables deal with dynamically reseting the stop loss...and the way I am using these variables, it makes no sense to run through an iteration when VAR1 >= VAR2. But I know going through all cases of VAR1=1..10/VAR2=1..10 is going through twice as many iterations as it needs to.

        Anyway, thanks everyone for your thoughts and help. Maybe I'll be able to crack this...maybe not. Heck, maybe NT7 will give me more controls in the optimizer and the inputs ... maybe I'll be able to make this work!

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by geotrades1, Today, 10:02 AM
        1 response
        4 views
        0 likes
        Last Post NinjaTrader_BrandonH  
        Started by ender_wiggum, Today, 09:50 AM
        1 response
        5 views
        0 likes
        Last Post NinjaTrader_Gaby  
        Started by rajendrasubedi2023, Today, 09:50 AM
        1 response
        12 views
        0 likes
        Last Post NinjaTrader_BrandonH  
        Started by bmartz, Today, 09:30 AM
        1 response
        9 views
        0 likes
        Last Post NinjaTrader_Erick  
        Started by geddyisodin, Today, 05:20 AM
        3 responses
        26 views
        0 likes
        Last Post NinjaTrader_Gaby  
        Working...
        X