Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

CumProfit on NT6.5 and NT7

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

    CumProfit on NT6.5 and NT7

    Hello.
    The following code working in NT6,5 but does not work in NT7:

    Code:
    protected override void OnBarUpdate()
            {
    			if (BarsInProgress == 1)
    		    {			
    			if (Bars.FirstBarOfSession)				
    			    {
    				// Store the strategy's prior cumulated realized profit and number of trades
    				priorTradesCumProfit = Performance.AllTrades.TradesPerformance.Currency.CumProfit;
    			    }				
    		    }		
            }
    		/// <summary>
            /// Called on each incoming execution
            /// </summary>
            protected override void OnExecution(IExecution execution)
            {
              if (BarsInProgress == 1)
    		{
    			if (Performance.AllTrades.TradesPerformance.Currency.CumProfit > priorTradesCumProfit )
    			   {blokadaPierwszegoWybicia = true;}
    							   
    			if (Performance.AllTrades.TradesPerformance.Currency.CumProfit <= priorTradesCumProfit)
    			   {blokadaPierwszegoWybicia = false;}			   
    		 }
    		}
    In NT6.5 flag change state:
    8/11/2010 8:11:00 AMprofit =11742.5
    8/11/2010 8:11:00 AMblokadaPierwszegoWybicia =False
    8/11/2010 8:11:00 AMpriorTradesCumProfit =11742.5
    8/11/2010 8:12:00 AMprofit =15242.5
    8/11/2010 8:12:00 AMblokadaPierwszegoWybicia =True
    8/11/2010 8:12:00 AMpriorTradesCumProfit =11742.5

    In NT7 flag do not change state:
    8/11/2010 8:11:00 AMprofit =11237.5
    8/11/2010 8:11:00 AMblokadaPierwszegoWybicia =False
    8/11/2010 8:11:00 AMpriorTradesCumProfit =11237.5
    8/11/2010 8:12:00 AMprofit =19382.5
    8/11/2010 8:12:00 AMblokadaPierwszegoWybicia =False
    8/11/2010 8:12:00 AMpriorTradesCumProfit =11237.5

    How to fix this problem.
    Rgds
    Czarek.

    #2
    Hi Czarek, please add prints to see if your custom logic is called at all to change the flag, is there an execution to trigger it?

    Comment


      #3
      Bertrand.
      Here is output from:
      Ninja 6.5 where flag blokadaPierwszegoWybicia change state for True:
      Code:
      8/11/2010 8:11:00 AMprofit =11742.5
      8/11/2010 8:11:00 AMblokadaPierwszegoWybicia =False
      8/11/2010 8:11:00 AMpriorTradesCumProfit =11742.5
      8/11/2010 8:11:00 AM Entered internal PlaceOrder() method at 8/11/2010 8:11:00 AM: Action=Sell OrderType=Market Quantity=0 LimitPrice=0 StopPrice=0 SignalName='2ExitLong1' FromEntrySignal=''
      8/11/2010 8:12:00 AMprofit =14657.5
      8/11/2010 8:12:00 AMblokadaPierwszegoWybicia =True
      8/11/2010 8:12:00 AMpriorTradesCumProfit =11742.5
      Here is output from
      Ninja 7 where blokadaPierwszegoWybicia do not change state and stay False:
      Code:
      8/11/2010 8:11:00 AMprofit =11237.5
      8/11/2010 8:11:00 AMblokadaPierwszegoWybicia =False
      8/11/2010 8:11:00 AMpriorTradesCumProfit =11237.5
      8/11/2010 8:11:00 AM Entered internal PlaceOrder() method at 8/11/2010 8:11:00 AM: BarsInProgress=1 Action=Sell OrderType=Market Quantity=0 LimitPrice=0 StopPrice=0 SignalName='ExitLong1' FromEntrySignal=''
      8/11/2010 8:12:00 AMprofit =19382.5
      8/11/2010 8:12:00 AMblokadaPierwszegoWybicia =False
      8/11/2010 8:12:00 AMpriorTradesCumProfit =11237.5
      8/11/2010 8:12:00 AM Entered internal PlaceOrder() method at 8/11/2010 8:12:00 AM: BarsInProgress=1 Action=Sell OrderType=Market Quantity=0 LimitPrice=0 StopPrice=0 SignalName='ExitLong1' FromEntrySignal=''
      8/11/2010 8:12:00 AM Ignored PlaceOrder() method: Action=Sell OrderType=Market Quantity=0 LimitPrice=0 StopPrice=0 SignalName='ExitLong1' FromEntrySignal='' Reason='This was an exit order but no position exists to exit'
      8/11/2010 8:13:00 AMprofit =19382.5
      8/11/2010 8:13:00 AMblokadaPierwszegoWybicia =False
      8/11/2010 8:13:00 AMpriorTradesCumProfit =11237.5
      8/11/2010 8:13:00 AM Entered internal PlaceOrder() method at 8/11/2010 8:13:00 AM: BarsInProgress=1 Action=Sell OrderType=Market Quantity=0 LimitPrice=0 StopPrice=0 SignalName='ExitLong1' FromEntrySignal=''
      8/11/2010 8:13:00 AM Ignored PlaceOrder() method: Action=Sell OrderType=Market Quantity=0 LimitPrice=0 StopPrice=0 SignalName='ExitLong1' FromEntrySignal='' Reason='This was an exit order but no position exists to exit'
      8/11/2010 8:14:00 AMprofit =19382.5
      Czarek.

      Comment


        #4
        Czarek, can you please attach or send to support at ninjatrader dot com the full code you run so I can run comparisons on my end here?

        Thanks

        Comment


          #5
          I've just send you email.
          Subject "For Bertrand Re: CumProfit on NT6.5 and NT7 from forum."

          Czarek.

          Comment


            #6
            Ok, thanks - will take a look Czarek.

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by Geovanny Suaza, 02-11-2026, 06:32 PM
            0 responses
            582 views
            0 likes
            Last Post Geovanny Suaza  
            Started by Geovanny Suaza, 02-11-2026, 05:51 PM
            0 responses
            338 views
            1 like
            Last Post Geovanny Suaza  
            Started by Mindset, 02-09-2026, 11:44 AM
            0 responses
            103 views
            0 likes
            Last Post Mindset
            by Mindset
             
            Started by Geovanny Suaza, 02-02-2026, 12:30 PM
            0 responses
            554 views
            1 like
            Last Post Geovanny Suaza  
            Started by RFrosty, 01-28-2026, 06:49 PM
            0 responses
            552 views
            1 like
            Last Post RFrosty
            by RFrosty
             
            Working...
            X