• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

CalculateOnBarClose = false

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

  • fiddy
    started a topic CalculateOnBarClose = false

    CalculateOnBarClose = false

    I have set CalculateOnBarClose = false within the strategy code
    yet when I run the strategy the entry signals are not being generated until the start of the next bar.
    Is there anything else which could be impacting this?

  • NinjaTrader_Bertrand
    replied
    You could look into simulating those conditions on a lower timeframe series thus to be able to look inside that bigger timeframe bar. For order submission and fills, you can send them as well to a finer series - we have a reference sample to demonstrate this technique - http://www.ninjatrader.com/support/f...ead.php?t=6652

    Leave a comment:


  • fiddy
    replied
    Thanks for the reply. Is there anything I can do then in back testing to enable me to test when setting is false.

    Leave a comment:


  • NinjaTrader_Bertrand
    replied
    Correct, in backtesting there would be no option to set CalculateOnBarClose to false, thus it would be true all the times as historical data is processed. Even if you set this in your code, the processing for that part of the data is still CalculateOnBarClose == true.

    Leave a comment:


  • fiddy
    replied
    Hi Bertrand,

    Apologies I do not follow what you have explained.
    I am in the strategy analyser and in the toolbar that appears on right, there is no CalculateOnBarClose field.

    Leave a comment:


  • NinjaTrader_Bertrand
    replied
    fiddy, if you don't see the UI option for CalculateOnBarClose - are you in the backtesting engine then as this is seen? Here there would be no option to work on any other CalculateOnBarClose then true, as per default the intrabar formation of the bars would not be known.

    Leave a comment:


  • fiddy
    replied
    In the UI I cannot see a CalculateonBarClose Option
    Below is the code I have so far, which is waiting to the next bar
    Should I be using something other than CLOSE[0]

    protectedoverridevoid Initialize()
    {
    ExitOnClose =
    true;
    CalculateOnBarClose =
    false;
    DefaultQuantity =
    100;
    }
    ///<summary>
    /// Called on each bar update event (incoming tick)
    ///</summary>
    protectedoverridevoid OnBarUpdate()
    {
    if (Bars.FirstBarOfSession)
    {
    LowSupport = PriorDayOHLC().PriorLow[
    0];
    HighResistance = PriorDayOHLC().PriorHigh[
    0];
    }

    // Condition set 1
    if (CurrentDayOHL().CurrentOpen[0] < LowSupport
    && Close[
    0] > LowSupport)
    {
    EnterLong(DefaultQuantity,
    "");

    Leave a comment:


  • NinjaTrader_Bertrand
    replied
    fiddy, and when you check the UI parameters of the running strategy, it's still set to false correct?

    Do you have any logic in FirstTickOfBar?

    What indicator do you call in your script? Any custom ones that might have the COBC setting explicitly set in their own Initialize() as well?

    Leave a comment:

Latest Posts

Collapse

Topics Statistics Last Post
Started by Hanstanz, Today, 04:44 AM
0 responses
6 views
0 likes
Last Post Hanstanz  
Started by juniortut, Today, 04:38 AM
0 responses
5 views
0 likes
Last Post juniortut  
Started by rojiinko, Today, 03:58 AM
0 responses
4 views
0 likes
Last Post rojiinko  
Started by mreanuzlazx, Today, 01:30 AM
0 responses
4 views
0 likes
Last Post mreanuzlazx  
Started by xinepev, Today, 12:33 AM
0 responses
4 views
0 likes
Last Post xinepev
by xinepev
 
Working...
X