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 PhillT, Today, 02:16 PM
        2 responses
        6 views
        0 likes
        Last Post PhillT
        by PhillT
         
        Started by Kaledus, Today, 01:29 PM
        3 responses
        10 views
        0 likes
        Last Post NinjaTrader_Jesse  
        Started by frankthearm, Yesterday, 09:08 AM
        14 responses
        47 views
        0 likes
        Last Post NinjaTrader_Clayton  
        Started by gentlebenthebear, Today, 01:30 AM
        2 responses
        14 views
        0 likes
        Last Post gentlebenthebear  
        Started by PaulMohn, Today, 12:36 PM
        2 responses
        17 views
        0 likes
        Last Post PaulMohn  
        Working...
        X