NexusFi: Find Your Edge


Home Menu

 





Close[0] not waiting until bar close


Discussion in NinjaTrader

Updated
      Top Posters
    1. looks_one dsraider with 2 posts (0 thanks)
    2. looks_two Big Mike with 1 posts (1 thanks)
    3. looks_3 eDanny with 1 posts (3 thanks)
    4. looks_4 Quick Summary with 1 posts (0 thanks)
    1. trending_up 3,817 views
    2. thumb_up 4 thanks given
    3. group 0 followers
    1. forum 4 posts
    2. attach_file 0 attachments




 
Search this Thread

Close[0] not waiting until bar close

  #1 (permalink)
dsraider
New York, NY
 
Posts: 142 since Dec 2009
Thanks Given: 41
Thanks Received: 87

Dumb question...

Due to the trail stop code I have in my strat, I have to keep CalculateOnBarClose set to false so as of right now, Close[0] > Open[0] means the instant current price is greater than open, I enter. However, as part of my entry signal, I need to have Close[0] actually mean close of current bar. Is there a way I can have both?

Thanks,
Dave

Reply With Quote

Can you help answer these questions
from other members on NexusFi?
ZombieSqueeze
Platforms and Indicators
Cheap historycal L1 data for stocks
Stocks and ETFs
NT7 Indicator Script Troubleshooting - Camarilla Pivots
NinjaTrader
About a successful futures trader who didnt know anythin …
Psychology and Money Management
What broker to use for trading palladium futures
Commodities
 
  #3 (permalink)
 
eDanny's Avatar
 eDanny 
East Rochester, NY
 
Experience: Intermediate
Platform: NT
Posts: 329 since Jul 2009
Thanks Given: 18
Thanks Received: 425


You need to use something like this:

if(FirstTickOfBar)
{
use Close[1] here in calculation instead of Close[0]
}

Reply With Quote
Thanked by:
  #4 (permalink)
 
Big Mike's Avatar
 Big Mike 
Manta, Ecuador
Site Administrator
Developer
Swing Trader
 
Experience: Advanced
Platform: Custom solution
Broker: IBKR
Trading: Stocks & Futures
Frequency: Every few days
Duration: Weeks
Posts: 50,465 since Jun 2009
Thanks Given: 33,242
Thanks Received: 101,665

Yup eDanny is right, and remember that applies to everything, not just Close[1]. Like if you wanted to know what the SMA was, you have to look 1 bar ago, because FirstTickOfBar is just that -- the first tick of a NEW bar, not the Last Tick of the last bar.

Mike



Join the free Markets Chat beta: one platform, all the trade rooms!

We're here to help: just ask the community or contact our Help Desk

Quick Links: Change your Username or Register as a Vendor
Searching for trading reviews? Review this list
Lifetime Elite Membership: Sign-up for only $149 USD
Exclusive money saving offers from our Site Sponsors: Browse Offers
Report problems with the site: Using the NexusFi changelog thread
Follow me on Twitter Visit my NexusFi Trade Journal Reply With Quote
Thanked by:
  #5 (permalink)
dsraider
New York, NY
 
Posts: 142 since Dec 2009
Thanks Given: 41
Thanks Received: 87

That did it! I owe you both a drink.

Related - I wonder if this will help with the CancelOrder() issue I've noticed with the automated strat I posted. Will check ASAP and will post updated version if all goes well.

Thanks,
Dave

Reply With Quote




Last Updated on February 11, 2010


© 2024 NexusFi™, s.a., All Rights Reserved.
Av Ricardo J. Alfaro, Century Tower, Panama City, Panama, Ph: +507 833-9432 (Panama and Intl), +1 888-312-3001 (USA and Canada)
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.
About Us - Contact Us - Site Rules, Acceptable Use, and Terms and Conditions - Privacy Policy - Downloads - Top
no new posts