CalculateOnBarClose = false versus OnMarketData() - NinjaTrader Programming | futures io social day trading
futures io futures trading


CalculateOnBarClose = false versus OnMarketData()
Updated: Views / Replies:1,270 / 8
Created: by MWinfrey 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
 

CalculateOnBarClose = false versus OnMarketData()

  #1 (permalink)
Elite Member
Lubbock TX
 
Futures Experience: Intermediate
Platform: NinjaTrader
Broker/Data: Stage 5 Trading
Favorite Futures: CL
 
MWinfrey's Avatar
 
Posts: 1,879 since Jul 2009
Thanks: 1,449 given, 3,306 received

CalculateOnBarClose = false versus OnMarketData()

I've known for some time about OnMarketData and how it processes every tick that comes in but never connected the dots between it and CalculateOnBarClose = false.

I may say some things that aren't technically accurate because I don't completely know everything that goes on under the hood of NT. However, I will make statements based on observation and testing. I use Chart Trader and I've noticed many times where I have a limit order in place and it is filled without price going through it. I also realize that NT does not update the chart every tick because of the increased resource utilization that is caused by updating every tick. In fact there is a lower limit that prevents you from displaying every tick on the chart. Take a look at the "Display update interval (sec)" property that can be found in the Chart Properties. That property can not be set to 0. What that means is that a bar range may not show the true range of a bar. It could be off by a tick or 2. That is why limit orders can be filled without price going through. I think this situation only applies to OnBarUpdate and CalculateOnBarClose = false. I say that because using OnMarketData(MarketDataEventArgs e) in my programming I can see e.Price changing when there is no price change on the chart. Put this code into an indicator then put it on a chart and you will see what I mean.

 
Code
		
protected override void OnMarketData(MarketDataEventArgs e)
{
    DrawHorizontalLine("eprice",e.Price,Color.Black);
}

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)
Market Wizard
Columbus, OH
 
Futures Experience: None
Platform: NT 8, TOS
Favorite Futures: ES
 
Silvester17's Avatar
 
Posts: 3,332 since Aug 2009
Thanks: 4,579 given, 10,313 received



MWinfrey View Post
I've known for some time about OnMarketData and how it processes every tick that comes in but never connected the dots between it and CalculateOnBarClose = false.

I may say some things that aren't technically accurate because I don't completely know everything that goes on under the hood of NT. However, I will make statements based on observation and testing. I use Chart Trader and I've noticed many times where I have a limit order in place and it is filled without price going through it. I also realize that NT does not update the chart every tick because of the increased resource utilization that is caused by updating every tick. In fact there is a lower limit that prevents you from displaying every tick on the chart. Take a look at the "Display update interval (sec)" property that can be found in the Chart Properties. That property can not be set to 0. What that means is that a bar range may not show the true range of a bar. It could be off by a tick or 2. That is why limit orders can be filled without price going through. I think this situation only applies to OnBarUpdate and CalculateOnBarClose = false. I say that because using OnMarketData(MarketDataEventArgs e) in my programming I can see e.Price changing when there is no price change on the chart. Put this code into an indicator then put it on a chart and you will see what I mean.

 
Code
		
protected override void OnMarketData(MarketDataEventArgs e)
{
    DrawHorizontalLine("eprice",e.Price,Color.Black);
}

I don't understand. why does price have to go through the limit? it depends where your order is in the queue.

I also don't believe that range bars are off 1 or 2 ticks.


Last edited by Silvester17; September 30th, 2013 at 10:56 PM. Reason: wrong statement
Reply With Quote
The following user says Thank You to Silvester17 for this post:
 
  #4 (permalink)
Elite Member
Lubbock TX
 
Futures Experience: Intermediate
Platform: NinjaTrader
Broker/Data: Stage 5 Trading
Favorite Futures: CL
 
MWinfrey's Avatar
 
Posts: 1,879 since Jul 2009
Thanks: 1,449 given, 3,306 received


Silvester17 View Post
I don't understand. why does price have to go through the limit? it depends where your order is in the queue. just think, someone is always selling at the high, and this is certainly not a market order.

I also don't believe that range bars are off 1 or 2 ticks.

Someone else needs to answer his question about the limit order. What I describe what I've always been told by those who are theoretically in the know. I may be totally wrong but my observations support my statement. I just had an occurrence of just what I describe a few minutes ago. Price on my 1 minute chart merely touched the limit order but e.Price did go through and filled. I'm including the indicator I described in my previous post. Put it on a chart and you will see what I mean about the chart price versus e.Price.

Attached Files
Register to download File Type: zip OnMarketDataDemo.zip (1.5 KB, 22 views)
Reply With Quote
The following user says Thank You to MWinfrey for this post:
 
  #5 (permalink)
Market Wizard
Columbus, OH
 
Futures Experience: None
Platform: NT 8, TOS
Favorite Futures: ES
 
Silvester17's Avatar
 
Posts: 3,332 since Aug 2009
Thanks: 4,579 given, 10,313 received


MWinfrey View Post
Someone else needs to answer his question about the limit order. What I describe what I've always been told by those who are theoretically in the know. I may be totally wrong but my observations support my statement. I just had an occurrence of just what I describe a few minutes ago. Price on my 1 minute chart merely touched the limit order but e.Price did go through and filled. I'm including the indicator I described in my previous post. Put it on a chart and you will see what I mean about the chart price versus e.Price.

sorry for the confusion, but this was not a question. the futures markets operate that way, with 100% certainty.

what you're describing is more like a market maker market, like nasdaq. here, you normally can only sell at the bid or buy at the offer. in exchange, you won't have to pay a commission if you went through a market maker. and sometimes even there you can sell at the offer, but depending on the market maker again.

Reply With Quote
The following user says Thank You to Silvester17 for this post:
 
  #6 (permalink)
Elite Member
Lubbock TX
 
Futures Experience: Intermediate
Platform: NinjaTrader
Broker/Data: Stage 5 Trading
Favorite Futures: CL
 
MWinfrey's Avatar
 
Posts: 1,879 since Jul 2009
Thanks: 1,449 given, 3,306 received


Silvester17 View Post
sorry for the confusion, but this was not a question. the futures markets operate that way, with 100% certainty.

what you're describing is more like a market maker market, like nasdaq. here, you normally can only sell at the bid or buy at the offer. in exchange, you won't have to pay a commission if you went through a market maker. and sometimes even there you can sell at the offer, but depending on the market maker again.

Thanks for the clarification. Regardless, my point about NT still remains. There is a difference between e.Price and price you see on a chart. My problem is that I really don't know what the impact is other than display. If it's a display issue then I expect to see discrepancies between bars produced in a live market versus bars produced from historic data.

Example using a 1 minute chart.

Using the indicator I attached in a previous post, I've seen many times when e.Price exceeds the limit of the 1 minute bar as displayed on the chart. So, that 1 minute bar has a range on the live chart of 5 ticks when based on my indicator the 1 minute bar should really be 6 ticks. So, if I reload historic data, that same bar that was 5 ticks on a live chart should now show 6 ticks but I've never seen that. Someone please show me the error of my ways.

Reply With Quote
The following user says Thank You to MWinfrey for this post:
 
  #7 (permalink)
Elite Member
Birmingham UK
 
Futures Experience: Intermediate
Platform: NinjaTrader
Broker/Data: IG/eSignal
Favorite Futures: Dax
 
ratfink's Avatar
 
Posts: 3,336 since Dec 2012
Thanks: 11,276 given, 7,090 received


MWinfrey View Post
Thanks for the clarification. Regardless, my point about NT still remains. There is a difference between e.Price and price you see on a chart. My problem is that I really don't know what the impact is other than display. If it's a display issue then I expect to see discrepancies between bars produced in a live market versus bars produced from historic data.

Example using a 1 minute chart.

Using the indicator I attached in a previous post, I've seen many times when e.Price exceeds the limit of the 1 minute bar as displayed on the chart. So, that 1 minute bar has a range on the live chart of 5 ticks when based on my indicator the 1 minute bar should really be 6 ticks. So, if I reload historic data, that same bar that was 5 ticks on a live chart should now show 6 ticks but I've never seen that. Someone please show me the error of my ways.

Are you forgetting OnMarketData provides Bid, Ask and Last price changes? i.e. some of the prices will not be for actual trades.

Travel Well
Reply With Quote
The following user says Thank You to ratfink for this post:
 
  #8 (permalink)
Elite Member
Lubbock TX
 
Futures Experience: Intermediate
Platform: NinjaTrader
Broker/Data: Stage 5 Trading
Favorite Futures: CL
 
MWinfrey's Avatar
 
Posts: 1,879 since Jul 2009
Thanks: 1,449 given, 3,306 received


ratfink View Post
Are you forgetting OnMarketData provides Bid, Ask and Last price changes? i.e. some of the prices will not be for actual trades.

yes...which should I be looking at, Last?

Reply With Quote
 
  #9 (permalink)
Elite Member
Birmingham UK
 
Futures Experience: Intermediate
Platform: NinjaTrader
Broker/Data: IG/eSignal
Favorite Futures: Dax
 
ratfink's Avatar
 
Posts: 3,336 since Dec 2012
Thanks: 11,276 given, 7,090 received


MWinfrey View Post
yes...which should I be looking at, Last?

Yes, that will be the price for any that are actually executed.

Travel Well
Reply With Quote
The following user says Thank You to ratfink for this post:

Reply



futures io > > > > > CalculateOnBarClose = false versus OnMarketData()

Thread Tools Search this Thread
Search this Thread:

Advanced Search



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

Linda Bradford Raschke: Reading The Tape

Elite only

Adam Grimes: TBA

Elite only

NinjaTrader: TBA

January

Ran Aroussi: TBA

Elite only
     

Similar Threads
Thread Thread Starter Forum Replies Last Post
OnMarketData Problem humy65 NinjaTrader Programming 3 October 16th, 2012 11:17 AM
OnMarketData serious issue baberg NinjaTrader Programming 13 September 27th, 2011 10:04 AM
mystery d9po CalculateOnBarClose= False rcabri The Elite Circle 1 February 25th, 2011 01:28 PM
Is NT7 "CalculateOnBarClose = false" broken? Curbfeeler NinjaTrader 6 August 26th, 2010 07:53 PM
CalculateOnBarClose as a bool or as a simulation within OnBarUpdate chapter SARdynamite NinjaTrader Programming 5 July 5th, 2010 02:02 AM


All times are GMT -4. The time now is 05:41 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-11 in 0.50 seconds with 20 queries on phoenix via your IP 54.82.79.109