Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Position column of Strategy tab

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

    Position column of Strategy tab

    Hi,

    I have a strategy
    if (RSI(25, 3).Avg[0] >= Max)
    {
    EnterShort(
    500, "");
    }
    if (RSI(25, 3).Avg[0] <= Min)
    {
    EnterLong(
    500, "");
    }

    Initially I ran this strategy and then closed all the positions by the end of the day. The next day when i ran this, it shows position(eg:500S or 500L) in position column of Strategy tab even without executing any orders(no positions are hold) and the average price will be last day's entry price for the stock. So if the conditions in the above strategy satisfies, it sends out 2 orders, one for closing the position (i know EnterShort & EnterLong closes any open positions, in this case there aren't any open positions) and the other to enter the new position. In otherword after running a strategy a second time, the data in "Strategies" tab and "Positions" tab do not match.

    Is it some problem of the software or do i need to do any settings while creating/running a script strategy?
    Last edited by kirankksimon; 01-06-2009, 01:40 PM.

    #2
    kirankksimon,

    When you run a strategy it looks at all the historical data on your chart and evaluates out a strategy position. What you are seeing is a virtual strategy position. This position is what NT thinks you would have if you remained in the market the whole time. If you do not wish for it to process historically you will want to add this to the top of OnBarUpdate().

    Code:
    if (Historical)
         return;
    Josh P.NinjaTrader Customer Service

    Comment


      #3
      that was quick.

      thanks a lot

      But if that is a virtual position then Ninja shouldn't send an order for closing it.
      Last edited by kirankksimon; 01-06-2009, 01:52 PM.

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by bsbisme, Yesterday, 02:08 PM
      1 response
      15 views
      0 likes
      Last Post NinjaTrader_Gaby  
      Started by prdecast, Today, 06:07 AM
      0 responses
      3 views
      0 likes
      Last Post prdecast  
      Started by i019945nj, 12-14-2023, 06:41 AM
      3 responses
      60 views
      0 likes
      Last Post i019945nj  
      Started by TraderBCL, Today, 04:38 AM
      2 responses
      18 views
      0 likes
      Last Post TraderBCL  
      Started by martin70, 03-24-2023, 04:58 AM
      14 responses
      106 views
      0 likes
      Last Post martin70  
      Working...
      X