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,112 / 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 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
 

Managing Trade when Calculate on Close = True

  #11 (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

The indicator is called NCEP2, which is a product of EOT.
I have been testing with Calc at Bar Close on false. I have adjusted the indicator to calc on previous bar. The indicator does not plot correctly and does not trigger orders properly now.
I therefore need to Calculate on Bar Close to be True.

Here is the coding for the entry order method:

{
entryOrder1 = EnterLongLimit(
0, true, DefaultQuantity, Close[0] - 1 * TickSize , "Long 1a");

}

elseif (entryOrder1 != null && entryOrder2 != null && entryOrder1.LimitPrice != null && Close[0] == entryOrder1.LimitPrice + 3 * TickSize)
{
CancelOrder(entryOrder1);
}

Order is placed correctly, but if price moves away more than 3 ticks ( WITHIN THE CURRENT BAR ) it will no cancel order. ie - CALC on Bar CLOSE needs to be true.
Is there any other method of creating 2 seperate strategies and linking them. 1 with COBC = true and 2 with COBC = false.
It is practically impossible to have both in the same strategy, unless im missing something.

Thanks for the help though. Its been greatly appreciated.




Last edited by jthom; March 24th, 2010 at 04:29 AM.
Reply With Quote
The following user says Thank You to jthom for this post:
 
  #12 (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


jthom View Post

Order is placed correctly, but if price moves away more than 3 ticks ( WITHIN THE CURRENT BAR ) it will no cancel order. ie - CALC on Bar CLOSE needs to be true.

Hey jthom,

I completely understand your frustration, as I've been there, but I have to stay with my original suggestion. When COBC is set to true, Close[0] = close of the current bar, which is why your cancel order code isn't working properly. When COBC is set to false, Close[0] becomes current price, which is what you need for your cancel code. Since I don't think it's possible to have part of the strat set to true and part set to false, I still suggest using FirstTickOfBar and setting your indicator back a bar.

I went to the site and saw that this isn't a free indicator, so I can understand your not wanting to post. Unfortunately, however, it's hard to know exactly what to do without seeing it. Maybe you can x-out the words and just leave the numbers? So, turn "if (CrossAbove(EMA(20), EMA(50), 0))" to "if (XXX(XXX(20), XXX(50), 0))".

I saw that you tried setting it back one bar and I really do get what you're saying. My original suggestion SHOULD have worked. Maybe someone else will know better, but I don't think I'll be able to come up with anything else without seeing it. Let me know if you'd like me to try that.

Dave

Reply With Quote
The following user says Thank You to dsraider for this post:
 
  #13 (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


dsraider,

Thanks for your advice. Yeah if you set the tradedir[1] for the indicator it will calculate for previous bar, but wont plot an arrow which is required for strategy. Also my PC nearly fried 3 times setting bar close to false. Everything you stated should of worked in theory and I completely understand it. Ill just have to manually exit the order if price moves more than 3 - 4 ticks away.
Greatly appreciated for your help. It is amazing how helpful ppl are hear. Posting something similar on the NT Forums results in "See our Ninjascript Consultants."

Cheers dsraider

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

Sorry I couldn't be of more help, jthom. Best of luck on the NT forum. I have a strat with several indicators in it with COBC set to false and I really haven't noticed my computer dragging so I hope there's not another issue at play here.

Good luck,
Dave

Reply With Quote
 
  #15 (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 View Post

Posting something similar on the NT Forums results in "See our Ninjascript Consultants."


lol - true !


dsraider, these indicators are closed codes (.dlls) usualy, so it makes no sense to post the stuff.


jthom, the only additional idea i have is : ask Bill at EOT what the problem with the indicator is if used on cobc = false -- maybe he has another idea.

but if the indicator is the main signal-giver - maybe it makes no sense having flashing signals come and go all the time during on bar - especialy with rangebars wich can last longer time.
EOT so far as i know usualy wait for barclose to trigger their entrys.

max-td
Reply With Quote
 
  #16 (permalink)
Elite Member
Madison, WI
 
Futures Experience: Advanced
Platform: Sierra Charts, ALT
Favorite Futures: ES
 
aslan's Avatar
 
Posts: 614 since Jan 2010
Thanks: 342 given, 1,077 received

If you can only look at an indicator real time, then stash it in a dataseries, and check the previous value of the dataseries on first tick of bar.

// on every tick save value
myDataSeries.Set(indValue(parms));

if (FirstTickOfBar) {
// use previous value when new bar is formed
if (myDataSeries[1] .....) {
}
}

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 02:38 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-12 in 0.11 seconds with 19 queries on phoenix via your IP 54.90.207.75