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 Max238, Today, 01:28 AM
    1 response
    22 views
    0 likes
    Last Post CactusMan  
    Started by giulyko00, Yesterday, 12:03 PM
    2 responses
    10 views
    0 likes
    Last Post giulyko00  
    Started by r68cervera, Today, 05:29 AM
    0 responses
    4 views
    0 likes
    Last Post r68cervera  
    Started by geddyisodin, Today, 05:20 AM
    0 responses
    6 views
    0 likes
    Last Post geddyisodin  
    Started by JonesJoker, 04-22-2024, 12:23 PM
    6 responses
    38 views
    0 likes
    Last Post JonesJoker  
    Working...
    X