Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Cumulitive Profit not changing..

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

    #31
    For testing strategies in real time the simulated connection works great. It doesn't resemble live market data but lets you control and manipulate the markets: http://www.ninjatrader.com/support/h...connection.htm

    If you're testing on the weekend (or when your instrument would be closed) be sure to change the session template to something that would be open (such as default 24/7)
    LanceNinjaTrader Customer Service

    Comment


      #32
      Lance, I figured why the #'s were off. The output for example would read -.72 and the strategy analyzer window would read -146. I guess you have to multiply by the # of shares(in my case 200 shares). Then the the last digit being 2 less I guess is just commission.

      Still having the issue with the orders not closing out at end of day when backtesting, it's something to do with this line...

      // If our Long Limit order is still active we will need to cancel it.
      {
      CancelOrder(entryOrder);
      }

      What exactly does this mean, it says "if order is still active", does this mean that it's still flat but it's been activated and the fill order is pending?

      if so do I need to put some sort of IF condiition before it such as...

      if (order.OrderState == OrderState.PendingSubmit)

      or

      if (entryOrder != null)
      Last edited by zachj; 11-03-2013, 06:01 PM.

      Comment


        #33
        If you want the orders to close out at the end of the session you can set ExitOnClose = true; http://www.ninjatrader.com/support/h...xitonclose.htm

        If you want it to be a custom exit time you would want to create your own exit/flatten routine.

        Example pseudo code:

        Code:
        if(its the exit time)
        {
          if(myIOrder != null)
            CancelOrder(myIOrder); //will also want to set the order to null (typically this is done in OnOrderUpdate() )
        
        }
        LanceNinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Geovanny Suaza, 02-11-2026, 06:32 PM
        0 responses
        596 views
        0 likes
        Last Post Geovanny Suaza  
        Started by Geovanny Suaza, 02-11-2026, 05:51 PM
        0 responses
        343 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
        556 views
        1 like
        Last Post Geovanny Suaza  
        Started by RFrosty, 01-28-2026, 06:49 PM
        0 responses
        554 views
        1 like
        Last Post RFrosty
        by RFrosty
         
        Working...
        X