Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Performance All trades strategy analyzer issue

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

    Performance All trades strategy analyzer issue

    Hi at all!
    I have a strategy that all days resets a SystemPerformance.AllTrades.TradesPerformance.Curr ency.CumProfit .
    In the summary,( in the total net profit of all trades) i look the result of the last day, not the sum of long and short trades!

    I attached a screenshot that show better the problem.
    Attached Files

    #2
    Hello,

    Thank you for the question.

    Would you be able to provide a sample script that demonstrates what you have posted?

    I am unsure what code or logic is being used in the script to generate the values you have provided in the image.

    If I am able to duplicate this on my end or see the logic being used I may be able to assist further in finding the reason.

    I look forward to being of further assistance.
    JesseNinjaTrader Customer Service

    Comment


      #3
      This is the script:

      if ( Bars.IsFirstBarOfSession == true )

      {
      SystemPerformance.AllTrades.TradesPerformance.Curr ency.CumProfit = 0;
      }

      double cumProfit = SystemPerformance.AllTrades.TradesPerformance.Curr ency.CumProfit;
      double curPosition = Position.GetUnrealizedProfitLoss( PerformanceUnit.Currency, Close[0] );
      double totCumProfit = cumProfit + curPosition ;

      if( totCumProfit > dailyProfit ||
      totCumProfit < -dailyLoss )
      {
      CancelOrder( );
      _CloseLong = SubmitOrderUnmanaged();
      }

      Comment


        #4
        Hello,

        Thank you for the question.

        You are resetting the value of CumProfit to 0 which is not fully resetting the account as you are trying to do.

        As an example, if you run this code and then open the Realtime report, they would not match as soon as you have set 0 to this property.

        We have a sample that shows how to correctly "reset" for each day, in reality no data is reset or removed you simply do not use that portion of data in the equation.



        I look forward to being of further assistance.
        JesseNinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by trilliantrader, 04-18-2024, 08:16 AM
        4 responses
        18 views
        0 likes
        Last Post trilliantrader  
        Started by mgco4you, Today, 09:46 PM
        1 response
        7 views
        0 likes
        Last Post NinjaTrader_Manfred  
        Started by wzgy0920, Today, 09:53 PM
        0 responses
        9 views
        0 likes
        Last Post wzgy0920  
        Started by Rapine Heihei, Today, 08:19 PM
        1 response
        10 views
        0 likes
        Last Post NinjaTrader_Manfred  
        Started by Rapine Heihei, Today, 08:25 PM
        0 responses
        10 views
        0 likes
        Last Post Rapine Heihei  
        Working...
        X