Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Suggestions on strategy architecture. Flags

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

    Suggestions on strategy architecture. Flags

    Hello guys, and in particular Ray and Josh.

    Love the product! Great work.

    I am designing a strategy that looks at several indicators. The strategy looks for certain characteristics in each indicator.

    I plan to write some code that will set a variable each time that the certain condition relevant to each indicator is met.

    However, often these flags dont coincide on the same bar. So what I wanted to do was design a function that will place the flags into a dataseries, and then have a function that will look at if all the conditions are met within X amount of bars.

    For example some rough pseudocode:

    WHILE Trend is Up
    IF indicator1 = somecondition THEN set flag indicator1flag=1 into a
    dataseries
    IF indicator2 = othercondition THEN set flag idicator2flag=1 into a
    dataseries

    IF indicator1flag + indicator2flag in LAST X AMOUNT OF BARS = 2 then enter a long position.

    .....
    So essentially I want to have an array of values for each indicator:
    Indicator1: 0 0 0 0 0 0 1 0 0
    Indicator2: 0 0 0 0 0 0 0 1 0

    Then the order entry function will check all arrays and be true when the value is set within X amount of bars for all indicators.

    I hope you follow my concept. Would really appreciate if one of the forum gurus could suggest a nice structure for such a design.

    By the way I have also found using a while loop causes NT to crash every time. Is there a special syntax that I am missing or does anyone know what might be causing it?

    Cheers,

    Stephen
    Last edited by raz0rback; 06-09-2008, 10:10 PM.

    #2
    If you could post up your exact snippet for the while loop scenario we can investigate it.

    In regards to what you want to try and do you should have no problem doing it with the DataSeries object. To check your DataSeries object to see if it was true within x amount of bars you can either use a loop or maybe even use the MRO() method.
    Josh P.NinjaTrader Customer Service

    Comment


      #3
      Thanks for the tip on the MRO method.

      I have successfully built the strategy using the dataseries objects and the MRO method.

      The while loop issue has been overcome by using a different method.

      Thanks again for the great support guys. Very good customer service.

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by Geovanny Suaza, 02-11-2026, 06:32 PM
      0 responses
      597 views
      0 likes
      Last Post Geovanny Suaza  
      Started by Geovanny Suaza, 02-11-2026, 05:51 PM
      0 responses
      343 views
      1 like
      Last Post Geovanny Suaza  
      Started by Mindset, 02-09-2026, 11:44 AM
      0 responses
      103 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Started by Geovanny Suaza, 02-02-2026, 12:30 PM
      0 responses
      556 views
      1 like
      Last Post Geovanny Suaza  
      Started by RFrosty, 01-28-2026, 06:49 PM
      0 responses
      555 views
      1 like
      Last Post RFrosty
      by RFrosty
       
      Working...
      X