Managing Trade when Calculate on Close = True - NinjaTrader Programming | futures io social day trading
futures io futures trading


Managing Trade when Calculate on Close = True
Updated: Views / Replies:3,111 / 15
Created: by jthom Attachments:0

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 dont 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
 

Managing Trade when Calculate on Close = True

  #1 (permalink)
Elite Member
Sydney / Australia
 
Futures Experience: Intermediate
Platform: NT
Broker/Data: AMP
Favorite Futures: Oil
 
Posts: 116 since Jun 2009
Thanks: 125 given, 103 received

Managing Trade when Calculate on Close = True

Ok guys and gals,

Got a problem with my current strategy setup.
I have an indicator that effectively needs to calculate at the end of bar close. Therefore the strategy is set to calculate @ close.
However I have set up a method of when the indicator triggers, an entry order is placed 1 tick - the current bar's close (buy.) A cancel order is set to trigger if the price moves 3 ticks + the current order.
However because the strategy is set to calculate @ close, there has been repeated times where an order has been placed, then the price moving 4 -5 ticks with being filled. (ie the bar has not closed.)

How is it possible to for the order to be calculated tick for tick?
I heard of using OnMarketData but have no idea how to code it?
Any help would be great. Thanks

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)
Trading for Fun
New York, NY
 
Futures Experience: Advanced
Platform: NinjaTrader
Broker/Data: Amp Futures/Zen-Fire
Favorite Futures: ES
 
Posts: 142 since Dec 2009
Thanks: 41 given, 83 received


Hey jthom,

My only suggestion is to use CalculateOnBarClose = False, which will fix your cancel code and then use "FirstTickOfBar" in your entry code. When doing that, set your signal back one bar. So, instead of:

if (CrossAbove(EMA(20), EMA(50), 0)), use:

if (FirstTickOfBar && CrossAbove(EMA(20), EMA(50), 1))

This allows your signal to reach bar close before entering. There may be a better way out there but I THINK this will do what you want.

Dave

Reply With Quote
The following user says Thank You to dsraider for this post:
 
  #4 (permalink)
Elite Member
Sydney / Australia
 
Futures Experience: Intermediate
Platform: NT
Broker/Data: AMP
Favorite Futures: Oil
 
Posts: 116 since Jun 2009
Thanks: 125 given, 103 received

Hey bud,

I unfortunately have to use CalculateOnBarClose = True for my indicator.

Reply With Quote
 
  #5 (permalink)
Trading for Fun
New York, NY
 
Futures Experience: Advanced
Platform: NinjaTrader
Broker/Data: Amp Futures/Zen-Fire
Favorite Futures: ES
 
Posts: 142 since Dec 2009
Thanks: 41 given, 83 received

I hear you as I like to let the bar close before entering as well but this can be used as a fix. When you add FirstTickOfBar to your entry code and set your signal back a bar, it basically tells you strat to wait until your entry bar closes (like you want) and then enter at the first tick of the next bar. I then set my entry order to Open[0]. So, for the example I gave you, at the open of the current bar, the strat would check to see if the 20 crossed above the 50 on the close of the last bar. If it did, it would enter. Using this combo prevents the strat from taking trades mid-bar.

Unless I'm missing something (or too hungover to fully understand you), I think this will do it.

Good luck,
Dave

Reply With Quote
 
  #6 (permalink)
Elite Member
Sydney / Australia
 
Futures Experience: Intermediate
Platform: NT
Broker/Data: AMP
Favorite Futures: Oil
 
Posts: 116 since Jun 2009
Thanks: 125 given, 103 received

Ok im getting you. However how do i reference my signal from the previous bar?
I cannot use any price references - ie Close[1]

Reply With Quote
 
  #7 (permalink)
Trading for Fun
New York, NY
 
Futures Experience: Advanced
Platform: NinjaTrader
Broker/Data: Amp Futures/Zen-Fire
Favorite Futures: ES
 
Posts: 142 since Dec 2009
Thanks: 41 given, 83 received

Hmm....every indicator in your code SHOULD require you to decide which bar to choose ([0] being current, [1] being one bar back). Basically, if you see a [0], try changing it to [1]. If your signal isn't secret, I'd be happy to have a look. Otherwise, let's start with that.

Reply With Quote
 
  #8 (permalink)
Elite Member
Sydney / Australia
 
Futures Experience: Intermediate
Platform: NT
Broker/Data: AMP
Favorite Futures: Oil
 
Posts: 116 since Jun 2009
Thanks: 125 given, 103 received

hmm well its a custom indicator off a vendor. I have tried to use [1] but doesnt seem to work. When I set to calc at close to false, it becomes way too CPU intensive.
Is it possible to have 2 strategies running?
ie - One for the indicator, and the other being for order placement and trade management?

Reply With Quote
 
  #9 (permalink)
Trading for Fun
New York, NY
 
Futures Experience: Advanced
Platform: NinjaTrader
Broker/Data: Amp Futures/Zen-Fire
Favorite Futures: ES
 
Posts: 142 since Dec 2009
Thanks: 41 given, 83 received

I don't think that's possible but there are many people much more experienced with programming than I am. Maybe they know better. Is your indicator a free one? If so, I'll download and try and figure out the code. If not, maybe you can post or PM me the part that only includes the numbers? Sometimes, you don't get [0] but can have "(xxx, 0)" instead.

Reply With Quote
 
  #10 (permalink)
Elite Member
Frankfurt
 
Futures Experience: Intermediate
Platform: NinjaTrader
Favorite Futures: FGBL 6E B4
 
max-td's Avatar
 
Posts: 1,754 since Jun 2009
Thanks: 2,309 given, 917 received


jthom,
what indicator is this - or what kind if you dont wanna show it ?
is it a closed vendors .dll or an open code-indie made for you ?

maybe you can post it in elite if you dont want to make it too public - and we can have a look at ...

max-td
Reply With Quote

Reply



futures io > > > > > Managing Trade when Calculate on Close = True

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
Managing Drawdowns StkLab Psychology and Money Management 3 November 14th, 2014 01:31 AM
Indicators "Calculate on bar close" Question whatnext NinjaTrader 4 June 29th, 2011 06:48 PM
Calculate GAP (Close of Prior Day, Open of Current Day) bluemele NinjaTrader Programming 16 January 19th, 2011 10:19 PM
How to calculate Pivot points correctly: settlement or close ? trendisyourfriend The Elite Circle 6 June 10th, 2010 11:44 AM
True High and True Low kaywai NinjaTrader Programming 4 January 20th, 2010 04:09 PM


All times are GMT -4. The time now is 10:30 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-10 in 0.12 seconds with 19 queries on phoenix via your IP 54.221.73.186