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 argusthome, 03-08-2026, 10:06 AM
    0 responses
    85 views
    0 likes
    Last Post argusthome  
    Started by NabilKhattabi, 03-06-2026, 11:18 AM
    0 responses
    48 views
    0 likes
    Last Post NabilKhattabi  
    Started by Deep42, 03-06-2026, 12:28 AM
    0 responses
    29 views
    0 likes
    Last Post Deep42
    by Deep42
     
    Started by TheRealMorford, 03-05-2026, 06:15 PM
    0 responses
    32 views
    0 likes
    Last Post TheRealMorford  
    Started by Mindset, 02-28-2026, 06:16 AM
    0 responses
    67 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Working...
    X