Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

SystemPerformance call problems

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

    SystemPerformance call problems


    Hello,

    some weird problem accured yersterday. Since two months I test my strategies with marketreplay to get better results. In order to get all values I write every trade to a txt file. Since yesterday it wont write anything. I checked and discovered that the SystemPerformance.AllTrades.Call is alway 0 and I didnt chang a thing.

    I dont know why it worked so long and know it doesnt.

    if(CrossAbove(SMA(1), SMA(10), 1))
    EnterLong();


    int a = SystemPerformance.AllTrades.Count;
    int b = SystemPerformance.LongTrades.Count;
    int n = SystemPerformance.ShortTrades.Count;

    File.AppendAllText(path, a + " | " + b + " | " + n + Environment.NewLine);

    This a example to check the SystemPerformance, it always writes 0


    Thanks for Helping
    Stefan



    #2
    Hello Zoechmeister99,

    Welcome to the NinjaTrader forums!

    Is this code all within the same pass of OnBarUpdate()?

    If so, the order will not have been submitted or filled immediately after being called. It will take some time for these events to happen.

    As an order is filled it will trigger OnOrderUpdate().


    As the position is updated, as well as the SystemPerformance collection, OnPositionUpdate() will be triggered.


    Place the code within OnPositionUpdate, to record information after the SystemPerformance collection changes.
    Chelsea B.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Hwop38, 05-04-2026, 07:02 PM
    0 responses
    169 views
    0 likes
    Last Post Hwop38
    by Hwop38
     
    Started by CaptainJack, 04-24-2026, 11:07 PM
    0 responses
    324 views
    0 likes
    Last Post CaptainJack  
    Started by Mindset, 04-21-2026, 06:46 AM
    0 responses
    250 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by M4ndoo, 04-20-2026, 05:21 PM
    0 responses
    351 views
    0 likes
    Last Post M4ndoo
    by M4ndoo
     
    Started by M4ndoo, 04-19-2026, 05:54 PM
    0 responses
    180 views
    0 likes
    Last Post M4ndoo
    by M4ndoo
     
    Working...
    X