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 charlesugo_1, 05-26-2026, 05:03 PM
    0 responses
    55 views
    0 likes
    Last Post charlesugo_1  
    Started by DannyP96, 05-18-2026, 02:38 PM
    1 response
    142 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by CarlTrading, 05-11-2026, 05:56 AM
    0 responses
    160 views
    0 likes
    Last Post CarlTrading  
    Started by CarlTrading, 05-10-2026, 08:12 PM
    0 responses
    96 views
    0 likes
    Last Post CarlTrading  
    Started by Hwop38, 05-04-2026, 07:02 PM
    0 responses
    276 views
    0 likes
    Last Post Hwop38
    by Hwop38
     
    Working...
    X