Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

CalculateOnBarClose question

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

    CalculateOnBarClose question

    Hello, I need some guidance.

    I am writing a strategy that trades 2 contracts that will run on a 200 tic chart. I want to sell the first contract as soon as price extends beyond a moving average value. Since that can happen within a 200 tic bar, I am running with CalculateOnBarClose=false so that I can track price per tick and sell the first contract as soon as it passes beyond the moving average. However, I need to sell the second contract when the close of the entire 200 tick bar reaches another moving average level.

    The problem I am facing is that the Closing prices my program is processing is based off of each tick since I have CalculateOnBarClose set to false, but I also need to know the Closing price of the entire 200 tick bar to determine when to sell the second contract.

    Any advice is greatly appreciated!

    #2
    pman777, you can work both COBC true / false logic in your strategy script as desired for the conditions, a 'how to' is shown in this sample - http://www.ninjatrader.com/support/f...ad.php?t=19387

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by charlesugo_1, 05-26-2026, 05:03 PM
    0 responses
    57 views
    0 likes
    Last Post charlesugo_1  
    Started by DannyP96, 05-18-2026, 02:38 PM
    1 response
    143 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by CarlTrading, 05-11-2026, 05:56 AM
    0 responses
    161 views
    0 likes
    Last Post CarlTrading  
    Started by CarlTrading, 05-10-2026, 08:12 PM
    0 responses
    97 views
    0 likes
    Last Post CarlTrading  
    Started by Hwop38, 05-04-2026, 07:02 PM
    0 responses
    276 views
    0 likes
    Last Post Hwop38
    by Hwop38
     
    Working...
    X