NexusFi: Find Your Edge


Home Menu

 





CalculateOnBarClose as a bool or as a simulation within OnBarUpdate chapter


Discussion in NinjaTrader

Updated
      Top Posters
    1. looks_one cory with 2 posts (0 thanks)
    2. looks_two SARdynamite with 2 posts (0 thanks)
    3. looks_3 MXASJ with 1 posts (0 thanks)
    4. looks_4 Quick Summary with 1 posts (0 thanks)
    1. trending_up 4,021 views
    2. thumb_up 0 thanks given
    3. group 2 followers
    1. forum 5 posts
    2. attach_file 0 attachments




 
Search this Thread
  #1 (permalink)
 SARdynamite 
Belgium
 
Experience: Advanced
Platform: SaxoTrader
Broker: SaxoBank
Trading: ESTX
Posts: 289 since Dec 2009
Thanks Given: 243
Thanks Received: 110

Hello there,

Bummer question : would there be a trick to toggle CalculateOnBarClose as a bool parameter inside the OnBarUpdate chapter ? or simulate the same feature with CalculateOnBarClose=false on the Initialize chapter ?

Thanks you very much.


Started this thread Reply With Quote

Can you help answer these questions
from other members on NexusFi?
Iran Lebanon Problem Kills Switzerland Talks, Brent at $ …
Prediction Markets & Event Contracts
Czechia Live at 52.5% as England Rides 4-2 Wave to Co-Fa …
Prediction Markets & Event Contracts
No book, only a stair: journaling fills where price move …
Cryptocurrency
Trump Media to sell instant access to market-moving soci …
Traders Hideout
Without Pulisic, USA 61.5% Live vs. Australia -- France …
Prediction Markets & Event Contracts
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Want your NinjaTrader indicator created, free?
5 thanks
Afternoon-close session
1 thanks
Franks Trading Journey
1 thanks
Denied 20K payouts: Alpha Futures
1 thanks
FootPrintV2 Chart for NT8
1 thanks
  #3 (permalink)
 
cory's Avatar
 cory 
virginia
 
Experience: Intermediate
Platform: ninja
Trading: NQ
Posts: 6,099 since Jun 2009
Thanks Given: 877
Thanks Received: 8,098


seems like no straight way to do it
Identifying Close of Bar when CalculateOnBarClose = false - NinjaTrader Support Forum


Reply With Quote
  #4 (permalink)
 MXASJ 
Asia
 
Experience: Beginner
Platform: NinjaTrader, TOS
Posts: 796 since Jun 2009
Thanks Given: 109
Thanks Received: 801

SAR what exactly are you trying to do? Things that might help include adding a second data series. For example if you use 1 minute bars, COBC=true, you can add a one tick data series. That gives you access to end-of-bar and on-every-tick in a strategy. Also look at FirstTickOfBar.


Reply With Quote
  #5 (permalink)
 SARdynamite 
Belgium
 
Experience: Advanced
Platform: SaxoTrader
Broker: SaxoBank
Trading: ESTX
Posts: 289 since Dec 2009
Thanks Given: 243
Thanks Received: 110

Hello guys,

Let me explain what I intended in the first place.

My goal is to create an indicator which toggles sensitivity.

Let's say the indicator color candles when Close[0]>SMA(Close,14)[0] and another color on the downside. Let's say I run it on a 5min candle chart.

I'd like to use a bool to toggle sensitivity so that when I'm close to a so called potential reversal level, I switch sensitivity so that it shows 1min candle chart sensivity on the last bar of my 5min chart only.
So that the last real time candle is then 1min MA crossing and the past candles are 5min MA crossing.
This would lead me to react earlier without the pain to switch timeframe or use the multi-timeframe windows which I don't find practical.

I tried stuff to achieve this in a single indicator with no success.
Therefore, I ended up thinking to use 2 indicators that I'd install at the same time :
- 1min coloring on 5min timeframe (default timeframe actually) with CalculateOnBarClose=false
- 5min coloring on 5min chart with CalculateOnBarClose=true

In order to mask the 1min candles by the 5min candles up until the very last candle... I'm not sure you understand me :-)

Anyway as I would toggle frequently the 5min indicator, I would rather switch easily between 5min/5min and 5min/1min. I just want to create a handy parameter on the very top of the indicator setting window instead of having to find the "CalculateOnBarClose" line each time (which is placed in the middle of the parametters settings window so no quick find !)

I might sound complicated, but the use is aimed for a group of people. So I'm paying attention to details.

Sorry about my english. I'm french.

PS : I will create a new thread about this very indicator coding because it does not work properly and I can't find what I did wrong.

Thanks again...


Started this thread Reply With Quote
  #6 (permalink)
 
cory's Avatar
 cory 
virginia
 
Experience: Intermediate
Platform: ninja
Trading: NQ
Posts: 6,099 since Jun 2009
Thanks Given: 877
Thanks Received: 8,098

how about 1 sec bar, the close of bar 59 could be counted as the close of 5m or 1m bar.


Reply With Quote




Last Updated on July 5, 2010


© 2026 NexusFi®, s.a., All Rights Reserved.
Av Ricardo J. Alfaro, Century Tower, Panama City, Panama, Ph: +507 833-9432 (Panama and Intl), +1 888-312-3001 (USA and Canada)
All information is for educational use only and is not investment advice. There is a substantial risk of loss in trading commodity futures, stocks, options and foreign exchange products. Past performance is not indicative of future results.
About Us - Contact Us - Site Rules, Acceptable Use, and Terms and Conditions - Downloads - Top
no new posts