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 SalmaTrader, 07-07-2026, 10:26 PM
    0 responses
    50 views
    0 likes
    Last Post SalmaTrader  
    Started by CarlTrading, 07-05-2026, 01:16 PM
    0 responses
    22 views
    0 likes
    Last Post CarlTrading  
    Started by CaptainJack, 06-17-2026, 10:32 AM
    0 responses
    16 views
    0 likes
    Last Post CaptainJack  
    Started by kinfxhk, 06-17-2026, 04:15 AM
    0 responses
    22 views
    0 likes
    Last Post kinfxhk
    by kinfxhk
     
    Started by kinfxhk, 06-17-2026, 04:06 AM
    0 responses
    23 views
    0 likes
    Last Post kinfxhk
    by kinfxhk
     
    Working...
    X