Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

OnBarUpdate orders

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

    OnBarUpdate orders

    I would like to code a strategy if an indicator reaches a value, to execute my order.
    So for example, if the RSI reaches 70 I want the order execution, and not after the bar close.

    I set: CalculateOnBarClose = false

    if (RSI (3,1)[0] > 70)

    {
    ExitLong("EinstiegLong", "");
    }

    But while I am backtesting the strategy the order execution is only after the bar close and not immediately after the RSI is at 70.

    Thank you.
    Last edited by Ironman9973; 11-03-2012, 04:26 AM.

    #2
    "When indicators or strategies are running on historical data, OnBarUpdate() is only called on the close of each historical bar even if this property is set to false. This is due to the fact that with a historical data set, only the OHLCVT of the bar is known and not each tick that made up the bar."

    A direct quote from Help menu, not sure if it helps to solve your problem

    Comment


      #3
      Hello,

      If you'd like to execute the orders immediately when backtesting, you will need to Add() a finer data series to execute on. Please see our Reference Sample on Backtesting NinjaScript Strategies with an intrabar granularity:

      http://www.ninjatrader.com/support/f...ead.php?t=6652
      MatthewNinjaTrader Product Management

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by ErikY, Today, 07:02 AM
      1 response
      5 views
      0 likes
      Last Post NinjaTrader_RyanS  
      Started by pfsmedical, Today, 07:03 AM
      0 responses
      4 views
      0 likes
      Last Post pfsmedical  
      Started by KarstenKafl, Today, 07:01 AM
      0 responses
      3 views
      0 likes
      Last Post KarstenKafl  
      Started by albert852, Yesterday, 11:41 PM
      1 response
      8 views
      0 likes
      Last Post NinjaTrader_PaulH  
      Started by mikeytrader, 04-20-2009, 08:22 AM
      6 responses
      2,831 views
      0 likes
      Last Post NinjaTrader_Jason  
      Working...
      X