Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Strange Behavior

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

    Strange Behavior

    Hi

    I am developing a strategy that trades on a 1 min bar on the YM.

    in the initialize method i add a 1 min series Add(PeriodType.Minute, 1);

    to ensure that OnBarUpdate only processes the 1 min bar I have the following code at the beginning of OnBarUpdate.

    if (Bars.Period.BasePeriodType != PeriodType.Minute || Bars.Period.Value != 1) {
    return;
    }

    As I have added the 1 min series as well as forced the OnBarUpdate to only process the 1 min series I would expect the same result if I had my chart set to 1 min, 15 min or 60 min?

    I seem to be getting different results on some trades not all when I change the time frame of the chart.

    I have attached a screen shot of the chart showing the trades on a 1 min, 30 min & 60 min chart. As I said earlier as I am restricting the trades to the 1 min series I would have expected the results to be the same.

    I have tried resetting the DB to delete all historical data and forcing Ninja to download all data from scratch, still get the same result.

    Any ideas what could be the problem.

    Thanks

    Mike
    Last edited by upshon; 02-08-2011, 05:57 AM.

    #2
    Mike, it looks like you would use the Set() methods for the targets and stop loss? Those are not tied to any bars index - if you would like to work only on the added BIP please use the Exit() methods to be able to send the orders only to the desired BIP then.

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Geovanny Suaza, 02-11-2026, 06:32 PM
    0 responses
    662 views
    0 likes
    Last Post Geovanny Suaza  
    Started by Geovanny Suaza, 02-11-2026, 05:51 PM
    0 responses
    376 views
    1 like
    Last Post Geovanny Suaza  
    Started by Mindset, 02-09-2026, 11:44 AM
    0 responses
    110 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by Geovanny Suaza, 02-02-2026, 12:30 PM
    0 responses
    574 views
    1 like
    Last Post Geovanny Suaza  
    Started by RFrosty, 01-28-2026, 06:49 PM
    0 responses
    580 views
    1 like
    Last Post RFrosty
    by RFrosty
     
    Working...
    X