COBC false indicators on COBC true strategy - NinjaTrader Programming | futures io social day trading
futures io futures trading


COBC false indicators on COBC true strategy
Updated: Views / Replies:1,722 / 10
Created: by daydaxer Attachments:2

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

COBC false indicators on COBC true strategy

  #1 (permalink)
Elite Member
Madrid/Spain
 
Futures Experience: Beginner
Platform: NinjaTrader
Broker/Data: Interactive Brokers/Kinetick
Favorite Futures: FDAX
 
Posts: 16 since Mar 2012
Thanks: 3 given, 6 received

COBC false indicators on COBC true strategy

Hi everybody!

In this thread I'm going to try to achieve something I find useful, and that currently Ninjatrader does not support: having Indicators calculated on real time (COBC false) on a CalculateOnBarClose strategy. NT support says it's not possible, but maybe we, together can achieve it.

My first thoughts:

1) We could achieve this by having a CalculateOnBarClose false strategy. All indicators would be then calculated on realtime, and we could handle COBC entry points by using FirstTickOfBar. Unfortunately backtesting a CalculateOnBarClose false strategy it's not very reliable.

2) We could achieve this by attaching a 1tick chart to the strategy, and discriminating on BarUpdate from the main chart (i.e. 1 minute) and the tick chart using BarsInProgress. So we basically could code two functions to be called in each case i.e OnBarTickUpdate() and OnBarCloseUpdate(). We could now place our code in either function depending on the granularity needed or wanted (i.e entries and trail stops on OnBarCloseUpdate and exits on OnBarTickUpdate). The only issue left is that if we want the main 1 min indicators to be updated with every OnBarTickUpdate() we need to hack something to make it work.


So, I think the way to go is the 2 option. But we need to be able to emulate the COBC false update of the indicators.

What we need is to calculate our own OHLC values for the current bar using tick data, and update the current bar of 1min indicators with them.

We could try this by:
A) Custom coding every single indicator we use in our estrategy, and replacing their use of High[], Low[], Close with our own code.

B) Adding code to the indicator class to handle this through all indicators.

At the moment I'm trying option B, I've tryed to overload the High, Low, Close Dataseries without success but I'll keep looking for a way to achieve this.

I just wanted to open this thread to hear other thoughts or ideas, and to post my advancement.

Cheers,
David.

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,602 received
Forum Reputation: Legendary


Why don't you simply add a secondary bar series built from 1-tick bars and have that bar series running set to CalculateOnBarClose = true?

Your indicators running on that secondary bar series will then be updated with every incoming tick, and you can use them within your strategy as required.

The only problem that I can see is that NinjaTrader does not support sub-second granularity on historical data, which can falsify a backtest.

Reply With Quote
 
  #4 (permalink)
Elite Member
Madrid/Spain
 
Futures Experience: Beginner
Platform: NinjaTrader
Broker/Data: Interactive Brokers/Kinetick
Favorite Futures: FDAX
 
Posts: 16 since Mar 2012
Thanks: 3 given, 6 received


Fat Tails View Post
Why don't you simply add a secondary bar series built from 1-tick bars and have that bar series running set to CalculateOnBarClose = true?

Your indicators running on that secondary bar series will then be updated with every incoming tick, and you can use them within your strategy as required.

Thanks Fat Tails, but the problem I have is that my exit conditions are based in the indicators running on the 1 minute bars, and I can't find a proper translation between those and the ones running in the 1 tick or even 1 second bars.

i.e. If I want to exit when DM[14].DIMinus>XXX on the 1 minute bars, How can I find the equivalent to that in the 1 tick o 1 second bars?

Reply With Quote
 
  #5 (permalink)
Elite Member
Madrid/Spain
 
Futures Experience: Beginner
Platform: NinjaTrader
Broker/Data: Interactive Brokers/Kinetick
Favorite Futures: FDAX
 
Posts: 16 since Mar 2012
Thanks: 3 given, 6 received


daydaxer View Post
i.e. If I want to exit when DM[14].DIMinus>XXX on the 1 minute bars, How can I find the equivalent to that in the 1 tick o 1 second bars?

Actually that's what my problem is about. I need to have 1 minute indicators updated on 1 tick data to emulate COBC false for those indicators.

Reply With Quote
 
  #6 (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


daydaxer View Post
Thanks Fat Tails, but the problem I have is that my exit conditions are based in the indicators running on the 1 minute bars, and I can't find a proper translation between those and the ones running in the 1 tick or even 1 second bars.

i.e. If I want to exit when DM[14].DIMinus>XXX on the 1 minute bars, How can I find the equivalent to that in the 1 tick o 1 second bars?

You need to code it. You can take the last known value of DM[14].DiMinus which was calculated from 1 min bars. Then you apply the DM indicator formulae to both the prior values of DM stored by the indicator and the last price retrieved by the 1-tick bar series.

The result is the current intrabar value of the indicator. That is all you need to do.

Reply With Quote
 
  #7 (permalink)
Elite Member
Madrid/Spain
 
Futures Experience: Beginner
Platform: NinjaTrader
Broker/Data: Interactive Brokers/Kinetick
Favorite Futures: FDAX
 
Posts: 16 since Mar 2012
Thanks: 3 given, 6 received


Fat Tails View Post
You need to code it. You can take the last known value of DM[14].DiMinus which was calculated from 1 min bars. Then you apply the DM indicator formulae to both the prior values of DM stored by the indicator and the last price retrieved by the 1-tick bar series.

The result is the current intrabar value of the indicator. That is all you need to do.

That was my original idea, but then I got greedy and I though we could be able to somehow overload the high, low, close for the current bar and modify the Indicator class to have that functionality in every indicator...

Maybe I was wishful thinking... :-)

Reply With Quote
 
  #8 (permalink)
Elite Member
Madrid/Spain
 
Futures Experience: Beginner
Platform: NinjaTrader
Broker/Data: Interactive Brokers/Kinetick
Favorite Futures: FDAX
 
Posts: 16 since Mar 2012
Thanks: 3 given, 6 received

Some code to prove the concept

Well, following Fat Tails advice, I dumped the idea of a general purpose solution and just coded what I needed. A COBC false DM indicator to handle my exits.

Here is the modified DM indicator and an example strategy (which just do print outs of the intrabar DM values)

Hope it helps someone else. Comments are welcome.

Attached Files
Register to download File Type: cs DMtick.cs (12.0 KB, 17 views)
Register to download File Type: cs COBTIndicators.cs (2.0 KB, 22 views)
Reply With Quote
The following 2 users say Thank You to daydaxer for this post:
 
  #9 (permalink)
Elite Member
Madrid/Spain
 
Futures Experience: Beginner
Platform: NinjaTrader
Broker/Data: Interactive Brokers/Kinetick
Favorite Futures: FDAX
 
Posts: 16 since Mar 2012
Thanks: 3 given, 6 received

Set of real time indicators

Hi,

I'm coding some other indicators that update in realtime even when using strategies with CalculateOnBarClose true.

I've coded so far: SMA, StdDev, DM, Bollinger and MACD indicators. RSI an some other will come soon.

I don't know if any of you guys have a use for them, but I was wondering if this thread was the proper place to upload them or should I place them somewhere else or under a better titled thread.

Any idea?

Reply With Quote
 
  #10 (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



daydaxer View Post
Hi,

I'm coding some other indicators that update in realtime even when using strategies with CalculateOnBarClose true.

I've coded so far: SMA, StdDev, DM, Bollinger and MACD indicators. RSI an some other will come soon.

I don't know if any of you guys have a use for them, but I was wondering if this thread was the proper place to upload them or should I place them somewhere else or under a better titled thread.

Any idea?


@daydaxer: You could upload them here, maybe someone will join the discussion.

Later the right place to post them would be the download section of this forum.

Reply With Quote

Reply



futures io > > > > > COBC false indicators on COBC true strategy

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
Bar End Result diifferent based on COBC? LostTrader NinjaTrader Programming 8 June 15th, 2011 08:50 PM
True or False Big Mike Off-Topic 147 June 2nd, 2011 06:19 PM
Quick COBC NinjaTrader Question Fat Tails NinjaTrader Programming 6 December 6th, 2010 01:29 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 06:31 AM.

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.14 seconds with 20 queries on phoenix via your IP 54.82.81.154