CalculateOnBarClose as a bool or as a simulation within OnBarUpdate chapter
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 ?
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.
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>SMA(Close,14) 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.