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 CarlTrading, 03-31-2026, 09:41 PM
    1 response
    63 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by CarlTrading, 04-01-2026, 02:41 AM
    0 responses
    35 views
    0 likes
    Last Post CarlTrading  
    Started by CaptainJack, 03-31-2026, 11:44 PM
    0 responses
    54 views
    1 like
    Last Post CaptainJack  
    Started by CarlTrading, 03-30-2026, 11:51 AM
    0 responses
    61 views
    0 likes
    Last Post CarlTrading  
    Started by CarlTrading, 03-30-2026, 11:48 AM
    0 responses
    48 views
    0 likes
    Last Post CarlTrading  
    Working...
    X