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 Geovanny Suaza, 02-11-2026, 06:32 PM
    0 responses
    649 views
    0 likes
    Last Post Geovanny Suaza  
    Started by Geovanny Suaza, 02-11-2026, 05:51 PM
    0 responses
    370 views
    1 like
    Last Post Geovanny Suaza  
    Started by Mindset, 02-09-2026, 11:44 AM
    0 responses
    109 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by Geovanny Suaza, 02-02-2026, 12:30 PM
    0 responses
    573 views
    1 like
    Last Post Geovanny Suaza  
    Started by RFrosty, 01-28-2026, 06:49 PM
    0 responses
    576 views
    1 like
    Last Post RFrosty
    by RFrosty
     
    Working...
    X