Bar End Result diifferent based on COBC? - NinjaTrader Programming | futures io social day trading
futures io futures trading


Bar End Result diifferent based on COBC?
Updated: Views / Replies:1,314 / 8
Created: by LostTrader Attachments:1

Welcome to futures io.

(If you already have an account, login at the top of the page)

futures io is the largest futures trading community on the planet, with over 90,000 members. At futures io, our goal has always been and always will be to create a friendly, positive, forward-thinking community where members can openly share and discuss everything the world of trading has to offer. The community is one of the friendliest you will find on any subject, with members going out of their way to help others. Some of the primary differences between futures io and other trading sites revolve around the standards of our community. Those standards include a code of conduct for our members, as well as extremely high standards that govern which partners we do business with, and which products or services we recommend to our members.

At futures io, our focus is on quality education. No hype, gimmicks, or secret sauce. The truth is: trading is hard. To succeed, you need to surround yourself with the right support system, educational content, and trading mentors Ė all of which you can find on futures io, utilizing our social trading environment.

With futures io, you can find honest trading reviews on brokers, trading rooms, indicator packages, trading strategies, and much more. Our trading review process is highly moderated to ensure that only genuine users are allowed, so you donít need to worry about fake reviews.

We are fundamentally different than most other trading sites:
  • We are here to help. Just let us know what you need.
  • We work extremely hard to keep things positive in our community.
  • We do not tolerate rude behavior, trolling, or vendors advertising in posts.
  • We firmly believe in and encourage sharing. The holy grail is within you, we can help you find it.
  • We expect our members to participate and become a part of the community. Help yourself by helping others.

You'll need to register in order to view the content of the threads and start contributing to our community.  It's free and simple.

-- Big Mike, Site Administrator

Reply
 
Thread Tools Search this Thread
 

Bar End Result diifferent based on COBC?

  #1 (permalink)
Elite Member
Tucson, AZ
 
Futures Experience: Intermediate
Platform: Ninjatrader
Broker/Data: Mirus/Zen-Fire
Favorite Futures: CL, TF
 
LostTrader's Avatar
 
Posts: 74 since Sep 2009
Thanks: 21 given, 62 received

Bar End Result diifferent based on COBC?

Why would the bar end result be different on a plot if running COBC true vs COBC false?

We are talking WMAs, EMAs here. Since the last tick will always replace prior intrabar tick results, the final input values should be the same. So seems to me that the outputs should also be the same.

I am having trouble wrapping my head around the thought that the outputs are different given the same inputs.
I feel like I am missing something obvious (wouldn't be the first time!)

Attached Thumbnails
Bar End Result diifferent based on COBC?-nt-cobc.png  
Reply With Quote
 
  #2 (permalink)
Quick Summary
Quick Summary Post

Quick Summary is created and edited by users like you... Add FAQ's, Links and other Relevant Information by clicking the edit button in the lower right hand corner of this message.

 
  #3 (permalink)
Elite Member
Berlin, Europe
 
Futures Experience: Advanced
Platform: NinjaTrader, MultiCharts
Broker/Data: Interactive Brokers
Favorite Futures: Keyboard
 
Fat Tails's Avatar
 
Posts: 9,653 since Mar 2010
Thanks: 4,226 given, 25,601 received
Forum Reputation: Legendary



LostTrader View Post
Why would the bar end result be different on a plot if running COBC true vs COBC false?

We are talking WMAs, EMAs here. Since the last tick will always replace prior intrabar tick results, the final input values should be the same. So seems to me that the outputs should also be the same.

I am having trouble wrapping my head around the thought that the outputs are different given the same inputs.
I feel like I am missing something obvious (wouldn't be the first time!)

For all properly coded indicator the end result will be identical. If set to CalcOnBarClose = false, NinjaTrader indicators will display intermediary values based on the temporary input values of price and volume. Once the bar is completed the indicator set to CalcOnBarClose=true will display the same result.

The only difference is that in CalcOnBarClose = false the unstable (unfinished) period is displayed, whereas for CalcOnBarClose = true it is not displayed, which makes up for an empty space instead of the indicator value.

If you are offline, NinjaTrader considers the last bar as incomplete, so the indicator may not show any value yet.

Reply With Quote
The following user says Thank You to Fat Tails for this post:
 
  #4 (permalink)
Elite Member
Tucson, AZ
 
Futures Experience: Intermediate
Platform: Ninjatrader
Broker/Data: Mirus/Zen-Fire
Favorite Futures: CL, TF
 
LostTrader's Avatar
 
Posts: 74 since Sep 2009
Thanks: 21 given, 62 received

Strategy vs Chart Indicator Panel


Fat Tails View Post
For all properly coded indicator the end result will be identical. If set to CalcOnBarClose = false, NinjaTrader indicators will display intermediary values based on the temporary input values of price and volume. Once the bar is completed the indicator set to CalcOnBarClose=true will display the same result.

The only difference is that in CalcOnBarClose = false the unstable (unfinished) period is displayed, whereas for CalcOnBarClose = true it is not displayed, which makes up for an empty space instead of the indicator value.

If you are offline, NinjaTrader considers the last bar as incomplete, so the indicator may not show any value yet.

Yeah, that's the way I see it too. And yet...

OK, could it be that the COBC true indicator was put on the chart from a Strategy and the COBC false was (already) placed on the chart through the Indicator panel? I cringe to think a Strategy will receive different values....

But I already know that code I write in a Indicator behaves differently when written in a Strategy.
That's what I have been working through the last few days.

P.S. I found the suspect code - the smoothing algorithm I was given to use will definitely not be the same intrabar vs EOB. Ah well, it will give me something to think about along woth the other stuff I am not getting done because I keep reading the forum.


Last edited by LostTrader; June 15th, 2011 at 02:43 PM. Reason: updated info
Reply With Quote
 
  #5 (permalink)
Elite Member
Berlin, Europe
 
Futures Experience: Advanced
Platform: NinjaTrader, MultiCharts
Broker/Data: Interactive Brokers
Favorite Futures: Keyboard
 
Fat Tails's Avatar
 
Posts: 9,653 since Mar 2010
Thanks: 4,226 given, 25,601 received
Forum Reputation: Legendary


LostTrader View Post
Yeah, that's the way I see it too. And yet...

OK, could it be that the COBC true indicator was put on the chart from a Strategy and the COBC false was (already) placed on the chart through the Indicator panel? I cringe to think a Strategy will receive different values....

But I already know that code I write in a Indicator behaves differently when written in a Strategy.
That's what I have been working through the last few days.

P.S. I found the suspect code - the smoothing algorithm I was given to use will definitely not be the same intrabar vs EOB. Ah well, it will give me something to think about along woth the other stuff I am not getting done because I keep reading the forum.

If CalcOnBarClose=false does not produce the same value in the end as CalcOnBarClose = true, it indicates that the indicator code is flawed, because the author has not understood which (iterating) calculations shall be only calculated when FirstTickOfBar is true, and which calculations can be performed with every incoming tick.

Note that historical bars have only 1 tick per bar, while real-time bars typically have many ticks per bar.

Reply With Quote
 
  #6 (permalink)
Site Administrator
Manta, Ecuador
 
Futures Experience: Advanced
Platform: My own custom solution
Favorite Futures: E-mini ES S&P 500
 
Big Mike's Avatar
 
Posts: 46,240 since Jun 2009
Thanks: 29,352 given, 83,229 received

NT strategies always operate on COBC true, there is no other option. You have to code a MTF strategy to get around that.

Most common problem people see with COBC false indicators is 'false' alerts, or alerts that occur or trigger when it is "false" that would not be shown later if the chart was refreshed. This is because:

1. In realtime, COBC false, a condition may happen intrabar that is no longer true at the end of bar. If your indicator does something intrabar, like draw an arrow, then unless you specifically add code to remove false arrows that arrow will remain even if at the end of the bar the condition is no longer true.

2. NT charts are built on historical data when loaded, and historical data is calculated only as COBC true. It is not possible to load a new chart and have the indicator values constructed as if COBC false was set on historical bars. This is a NT limitation.

Mike

Due to time constraints, please do not PM me if your question can be resolved or answered on the forum.

Need help?
1) Stop changing things. No new indicators, charts, or methods. Be consistent with what is in front of you first.
2) Start a journal and post to it daily with the trades you made to show your strengths and weaknesses.
3) Set goals for yourself to reach daily. Make them about how you trade, not how much money you make.
4) Accept responsibility for your actions. Stop looking elsewhere to explain away poor performance.
5) Where to start as a trader? Watch this webinar and read this thread for hundreds of questions and answers.
6)
Help using the forum? Watch this video to learn general tips on using the site.

If you want
to support our community, become an Elite Member.

Reply With Quote
The following user says Thank You to Big Mike for this post:
 
  #7 (permalink)
Elite Member
Tucson, AZ
 
Futures Experience: Intermediate
Platform: Ninjatrader
Broker/Data: Mirus/Zen-Fire
Favorite Futures: CL, TF
 
LostTrader's Avatar
 
Posts: 74 since Sep 2009
Thanks: 21 given, 62 received


Big Mike View Post
NT strategies always operate on COBC true, there is no other option. You have to code a MTF strategy to get around that.

MTF? I know when backtesting or optimizing, COBC will be true. But when running a strategy real-time on a chart, there is an option to change COBC. I would expect this to control more than simply the embedded indicators...


Quoting 
Most common problem people see with COBC false indicators is 'false' alerts, or alerts that occur or trigger when it is "false" that would not be shown later if the chart was refreshed. This is because:

1. In realtime, COBC false, a condition may happen intrabar that is no longer true at the end of bar. If your indicator does something intrabar, like draw an arrow, then unless you specifically add code to remove false arrows that arrow will remain even if at the end of the bar the condition is no longer true.

2. NT charts are built on historical data when loaded, and historical data is calculated only as COBC true. It is not possible to load a new chart and have the indicator values constructed as if COBC false was set on historical bars. This is a NT limitation.

Mike

Yes, I expect and code for these. Programming for accurate results for both COBC true, COBC false, and Historical has always keep NT life interesting. Thanks for the input!

Reply With Quote
 
  #8 (permalink)
Site Administrator
Manta, Ecuador
 
Futures Experience: Advanced
Platform: My own custom solution
Favorite Futures: E-mini ES S&P 500
 
Big Mike's Avatar
 
Posts: 46,240 since Jun 2009
Thanks: 29,352 given, 83,229 received

MTF = multiple time frames. I was referring to backtesting. Yes, live forward testing can use cobc = false, but not optimizing or backtesting.

Mike

Due to time constraints, please do not PM me if your question can be resolved or answered on the forum.

Need help?
1) Stop changing things. No new indicators, charts, or methods. Be consistent with what is in front of you first.
2) Start a journal and post to it daily with the trades you made to show your strengths and weaknesses.
3) Set goals for yourself to reach daily. Make them about how you trade, not how much money you make.
4) Accept responsibility for your actions. Stop looking elsewhere to explain away poor performance.
5) Where to start as a trader? Watch this webinar and read this thread for hundreds of questions and answers.
6)
Help using the forum? Watch this video to learn general tips on using the site.

If you want
to support our community, become an Elite Member.

Reply With Quote
The following user says Thank You to Big Mike for this post:
 
  #9 (permalink)
Elite Member
Tucson, AZ
 
Futures Experience: Intermediate
Platform: Ninjatrader
Broker/Data: Mirus/Zen-Fire
Favorite Futures: CL, TF
 
LostTrader's Avatar
 
Posts: 74 since Sep 2009
Thanks: 21 given, 62 received


Big Mike View Post
MTF = multiple time frames. I was referring to backtesting.

Oh, right! I understand.

Fortunately, I do not need that level of complexity.

Reply With Quote

Reply



futures io > > > > > Bar End Result diifferent based on COBC?

Thread Tools Search this Thread
Search this Thread:

Advanced Search



Upcoming Webinars and Events (4:30PM ET unless noted)

Jigsaw Trading: TBA

Elite only

FuturesTrader71: TBA

Elite only

NinjaTrader: TBA

Jan 18

RandBots: TBA

Jan 23

GFF Brokers & CME Group: Futures & Bitcoin

Elite only

Adam Grimes: TBA

Elite only

Ran Aroussi: TBA

Elite only
     

Similar Threads
Thread Thread Starter Forum Replies Last Post
Custom bar type - built based on filtered block size Big Mike NinjaTrader Programming 12 March 11th, 2014 12:18 AM
Quick COBC NinjaTrader Question Fat Tails NinjaTrader Programming 6 December 6th, 2010 01:29 PM
Opinions on COBC set to false in strategies jackyd NinjaTrader Programming 17 July 28th, 2009 12:32 PM
Poll result: Risk vs. Reward Big Mike Traders Hideout 0 June 11th, 2009 11:39 PM


All times are GMT -4. The time now is 10:34 PM.

Copyright © 2017 by futures io, s.a., Av Ricardo J. Alfaro, Century Tower, Panama, +507 833-9432, info@futures.io
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.
no new posts
Page generated 2017-12-13 in 0.14 seconds with 20 queries on phoenix via your IP 54.226.113.250