What is the difference between COBC true vs false? - NinjaTrader | futures io social day trading
futures io futures trading


What is the difference between COBC true vs false?
Updated: Views / Replies:2,047 / 18
Created: by ericson Attachments:3

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
 3  
 
Thread Tools Search this Thread
 

What is the difference between COBC true vs false?

  #11 (permalink)
Elite Member
Kirkland, WA/United States
 
Futures Experience: Intermediate
Platform: NinjaTrader
Broker/Data: Optimus/Vision/Rithmic
Favorite Futures: Futures
 
LightWeight's Avatar
 
Posts: 138 since Jul 2012
Thanks: 138 given, 42 received


Fat Tails View Post
This is not possible.

For further discussion please attach your strategies and a few samples showing that the live simulation strategy entered prior to the backtest.

@Fat Tails I've attached the code for the strategy here, as well as screen shots of the trades from a backtest over the last week vs. what the actual results were while running the strategy in live sim. You should be able to see clearly that:

A) the strategy uses market orders and COBC = true
B) the strategy in live trading always enters before the backtest
c) while the entry prices are usually still the same or within a tick, the exits are quite different

Also at the time of running this it was not including commission properly due to an error on my end (the backtest is including it), but all that means is that the discrepancy is even larger in terms of net profit. As it stands now, backtest shows a loss of $415 for the week, while live trading (WITHOUT comish) shows a loss of $850, so the live result was twice as bad as the backtest would indicate it would be.
Please register on futures.io to view futures trading content such as post attachment(s), image(s), and screenshot(s).

Please register on futures.io to view futures trading content such as post attachment(s), image(s), and screenshot(s).

Think big, think positive, never show any sign of weakness. Always go for the throat. Buy low, sell high. Fear? That's the other guy's problem. In this building, it's either kill or be killed. You make no friends in the pits and you take no prisoners. One minute you're up half a million in soybeans and the next, boom, your kids don't go to college and they've repossessed your Bentley. Are you with me?
Attached Files
Register to download File Type: cs CversARSShortSI.cs (113.6 KB, 8 views)
Reply With Quote
 
  #12 (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,602 received
Forum Reputation: Legendary


LightWeight View Post
@Fat Tails I've attached the code for the strategy here, as well as screen shots of the trades from a backtest over the last week vs. what the actual results were while running the strategy in live sim. You should be able to see clearly that:

A) the strategy uses market orders and COBC = true
B) the strategy in live trading always enters before the backtest
c) while the entry prices are usually still the same or within a tick, the exits are quite different

Also at the time of running this it was not including commission properly due to an error on my end (the backtest is including it), but all that means is that the discrepancy is even larger in terms of net profit. As it stands now, backtest shows a loss of $415 for the week, while live trading (WITHOUT comish) shows a loss of $850, so the live result was twice as bad as the backtest would indicate it would be.
Please register on futures.io to view futures trading content such as post attachment(s), image(s), and screenshot(s).

Please register on futures.io to view futures trading content such as post attachment(s), image(s), and screenshot(s).

@LightWeight: Your strategy uses both stop and limit orders, as you have set a stop loss and a profit target. Stop and limit orders will be executed intra-bar when trading live. During a backtest they are shown with the time stamp of the bar close.

Reply With Quote
The following 2 users say Thank You to Fat Tails for this post:
 
  #13 (permalink)
Elite Member
Kirkland, WA/United States
 
Futures Experience: Intermediate
Platform: NinjaTrader
Broker/Data: Optimus/Vision/Rithmic
Favorite Futures: Futures
 
LightWeight's Avatar
 
Posts: 138 since Jul 2012
Thanks: 138 given, 42 received



Fat Tails View Post
@LightWeight: Your strategy uses both stop and limit orders, as you have set a stop loss and a profit target. Stop and limit orders will be executed intra-bar when trading live. During a backtest they are shown with the time stamp of the bar close.

@Fat Tails Yes that's true, so that does explain the intra-bar discrepancy for live trading IF the stop or target is hit, but half the time neither the stop or target is hit, the signal changes and the strategy takes itself out with a market exit...but again, intra-bar, not waiting until the close like the backtest would (or like the strategy SHOULD if COBC = true).

Also this still doesn't explain to me why ENTRIES are occurring before the time stamps in backtest, as all entries are market orders, and should be COBC, and thus entered immediately as soon as the next bar starts, as indicated in the back test. Like I said my gut feeling is that the difference in results is largely explained by two things -- live trading executing entry intra-bar, instead of waiting until close; and live trading immediately exiting if exit conditions are reached intra-bar, instead of determining on the close and only exiting if the signal still holds (which is what backtest is doing). Because obviously the exit signal may no longer exist when the bar finally closes, then exit in backtest vs. live trading would vary considerably.

This is what is really frustrating me right now -- I have strategies that are profitable when entering and exiting at bar close, so in theory if I can get my live trading to do the same, to mirror that as closely as possible, then they should do better than they are currently....but as I said Ninja seems to be completely ignoring COBC and simply executing both entry AND exit as soon as signal is received.

Think big, think positive, never show any sign of weakness. Always go for the throat. Buy low, sell high. Fear? That's the other guy's problem. In this building, it's either kill or be killed. You make no friends in the pits and you take no prisoners. One minute you're up half a million in soybeans and the next, boom, your kids don't go to college and they've repossessed your Bentley. Are you with me?
Reply With Quote
 
  #14 (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,602 received
Forum Reputation: Legendary


LightWeight View Post
@Fat Tails Yes that's true, so that does explain the intra-bar discrepancy for live trading IF the stop or target is hit, but half the time neither the stop or target is hit, the signal changes and the strategy takes itself out with a market exit...but again, intra-bar, not waiting until the close like the backtest would (or like the strategy SHOULD if COBC = true).

Also this still doesn't explain to me why ENTRIES are occurring before the time stamps in backtest, as all entries are market orders, and should be COBC, and thus entered immediately as soon as the next bar starts, as indicated in the back test. Like I said my gut feeling is that the difference in results is largely explained by two things -- live trading executing entry intra-bar, instead of waiting until close; and live trading immediately exiting if exit conditions are reached intra-bar, instead of determining on the close and only exiting if the signal still holds (which is what backtest is doing). Because obviously the exit signal may no longer exist when the bar finally closes, then exit in backtest vs. live trading would vary considerably.

This is what is really frustrating me right now -- I have strategies that are profitable when entering and exiting at bar close, so in theory if I can get my live trading to do the same, to mirror that as closely as possible, then they should do better than they are currently....but as I said Ninja seems to be completely ignoring COBC and simply executing both entry AND exit as soon as signal is received.

@LightWeight: Yes, I can see that you strategy entered intra-bar during the live SIM test. I think that you had probably set the strategy to COBC = false via the dialogue box. Best you run it again and make sure that it is set to COBC = true.

Settings in the dialogue box override the line "CalculateOnBarClose = true", which is part of the Initialize section of the indicator.

Reply With Quote
The following user says Thank You to Fat Tails for this post:
 
  #15 (permalink)
Elite Member
Kirkland, WA/United States
 
Futures Experience: Intermediate
Platform: NinjaTrader
Broker/Data: Optimus/Vision/Rithmic
Favorite Futures: Futures
 
LightWeight's Avatar
 
Posts: 138 since Jul 2012
Thanks: 138 given, 42 received


Fat Tails View Post
@LightWeight: Yes, I can see that you strategy entered intra-bar during the live SIM test. I think that you had probably set the strategy to COBC = false via the dialogue box. Best you run it again and make sure that it is set to COBC = true.

Settings in the dialogue box override the line "CalculateOnBarClose = true", which is part of the Initialize section of the indicator.

@Fat Tails Unfortunately that isn't the problem either, I've carefully checked every time that COBC = true when setting up the strategy to run (it is also the default setting). In fact I even tried deliberately setting it to false (on another computer) on the off chance Ninja had it backward, but that just caused even more entries (all intra-bar as well). So the actual code is COBC = true, the dialogue box is COBC = true, and yet the strategies STILL go in early (and exit early when using a market order as well). I suppose at this point I should just ask Ninja support what's going on and see if they know, as we seem to agree that given the settings I have the entries in SIM should mirror the entries in backtest, and yet they do not, so something is clearly amiss.

Think big, think positive, never show any sign of weakness. Always go for the throat. Buy low, sell high. Fear? That's the other guy's problem. In this building, it's either kill or be killed. You make no friends in the pits and you take no prisoners. One minute you're up half a million in soybeans and the next, boom, your kids don't go to college and they've repossessed your Bentley. Are you with me?
Reply With Quote
 
  #16 (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,602 received
Forum Reputation: Legendary


LightWeight View Post
@Fat Tails Unfortunately that isn't the problem either, I've carefully checked every time that COBC = true when setting up the strategy to run (it is also the default setting). In fact I even tried deliberately setting it to false (on another computer) on the off chance Ninja had it backward, but that just caused even more entries (all intra-bar as well). So the actual code is COBC = true, the dialogue box is COBC = true, and yet the strategies STILL go in early (and exit early when using a market order as well). I suppose at this point I should just ask Ninja support what's going on and see if they know, as we seem to agree that given the settings I have the entries in SIM should mirror the entries in backtest, and yet they do not, so something is clearly amiss.

Did you run the SIM strategy on other than 1-minute bars?

Reply With Quote
 
  #17 (permalink)
Elite Member
Kirkland, WA/United States
 
Futures Experience: Intermediate
Platform: NinjaTrader
Broker/Data: Optimus/Vision/Rithmic
Favorite Futures: Futures
 
LightWeight's Avatar
 
Posts: 138 since Jul 2012
Thanks: 138 given, 42 received


Fat Tails View Post
Did you run the SIM strategy on other than 1-minute bars?

@Fat Tails No, the strategy ran on 1 minute bars, the same as the back test. I do have other strategies that run on say 3 minute or 5 minute bars, but again I keep the live sim with the same settings as the backtest, and have the same issues. I've also checked to make sure my PC clock is synched, though I don't think that would be the problem.

Think big, think positive, never show any sign of weakness. Always go for the throat. Buy low, sell high. Fear? That's the other guy's problem. In this building, it's either kill or be killed. You make no friends in the pits and you take no prisoners. One minute you're up half a million in soybeans and the next, boom, your kids don't go to college and they've repossessed your Bentley. Are you with me?
Reply With Quote
 
  #18 (permalink)
Elite Member
Kirkland, WA/United States
 
Futures Experience: Intermediate
Platform: NinjaTrader
Broker/Data: Optimus/Vision/Rithmic
Favorite Futures: Futures
 
LightWeight's Avatar
 
Posts: 138 since Jul 2012
Thanks: 138 given, 42 received

Okay, I think I may have figured some of this out then, but I'm not sure. First of all, if the time stamp for a backtest strategy entry is 7:45:00, would I be correct in assuming that the signal was actually calculated at 7:44:00, but that backtest is using the close price (and time) of the signal bar for entry? My assumption was that if it calculated the signal for entry as occurring on the bar close at 7:43:59/7:44:00, that it would then enter at the same spot...but it seems now that it actually enters on the close (or close price) of the bar immediately after the signal is calculated, which looks like a minute delay.

Second, I went back and looked at my time stamps for entry and then a 1 second chart, and I realized the entry problem -- because these are sim orders, then even though the are programmed for market trades, they can't actually fill until a real world trade takes place. In a market like Silver and in the evening, that may take 40 seconds or more into the one minute candle before a trade happens and a time stamp and price can be recorded in the simulator. So if we use what I'm guessing above -- that the entry signal was calculated at the close of the previous bar -- then COBC is in fact working properly and the signal was on the PREVIOUS bar, the time delay is simply due to the nature of sim requiring real world trades and the delay that causes, whereas in live trading obviously a market order would be filled right away, and I would see time stamp entries right around the bar open.

I think that solves my confusion about the entry time discrepancy, but the exit conditions are a little hazy. Again, as for the time delay I have to assume that's the same reason -- sim waiting for real world trades before it can record a transaction. The confusing bit is that sometimes the backtest exits much later, which makes me think that because backtest is exiting on the close, it is first calculating once again if the signal still exists BEFORE it will take itself out, and naturally sometimes the signal will have disappeared, so the strategy will actually not exit, while in live trading, because it did not wait until the bar close to exit, it would have already triggered.

If so, then if I wanted my exits to mirror backtest results more closely it seems like I would have to code the strategy to wait until the first tick of the next bar before exiting, and hope/assume that it is calculating whether the signal still exists before doing so. This is all conjecture but it's the closest I've gotten so far....at worst it seems like if I want live trading to more closely match backtesting then I need to code the strategy to wait until the first tick of the next bar to trade.

Think big, think positive, never show any sign of weakness. Always go for the throat. Buy low, sell high. Fear? That's the other guy's problem. In this building, it's either kill or be killed. You make no friends in the pits and you take no prisoners. One minute you're up half a million in soybeans and the next, boom, your kids don't go to college and they've repossessed your Bentley. Are you with me?
Reply With Quote
The following user says Thank You to LightWeight for this post:
 
  #19 (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,602 received
Forum Reputation: Legendary


LightWeight View Post
Second, I went back and looked at my time stamps for entry and then a 1 second chart, and I realized the entry problem -- because these are sim orders, then even though the are programmed for market trades, they can't actually fill until a real world trade takes place. In a market like Silver and in the evening, that may take 40 seconds or more into the one minute candle before a trade happens and a time stamp and price can be recorded in the simulator. So if we use what I'm guessing above -- that the entry signal was calculated at the close of the previous bar -- then COBC is in fact working properly and the signal was on the PREVIOUS bar, the time delay is simply due to the nature of sim requiring real world trades and the delay that causes, whereas in live trading obviously a market order would be filled right away, and I would see time stamp entries right around the bar open.

This looks like the key to understanding the different time stamps.

Reply With Quote

Reply



futures io > > > > What is the difference between COBC true vs false?

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
OnBarClose true for indicator false for strategy spinnybobo NinjaTrader Programming 1 April 5th, 2013 09:57 PM
COBC false indicators on COBC true strategy daydaxer NinjaTrader Programming 10 June 6th, 2012 03:56 AM
True or False Big Mike Off-Topic 147 June 2nd, 2011 06:19 PM
True Or False - a serious thread trendisyourfriend Traders Hideout 7 October 23rd, 2010 06:31 PM
Opinions on COBC set to false in strategies jackyd NinjaTrader Programming 17 July 28th, 2009 12:32 PM


All times are GMT -4. The time now is 01:58 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-17 in 0.15 seconds with 20 queries on phoenix via your IP 54.226.113.250