NexusFi: Find Your Edge


Home Menu

 





Close bar recognization in multi time frame strategy


Discussion in NinjaTrader

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




 
Search this Thread
  #1 (permalink)
 pinto552 
New York, NY
 
Experience: Advanced
Platform: Trade Navigator, CQG, Tradestation, Ninja, Interactive Brokers
Trading: Futures
Posts: 10 since May 2011
Thanks Given: 121
Thanks Received: 7

Hi Guys,

I have a simple question to ask. in this case I set CalculateOnClose = false, I have 10 minutes bar and 30 minutes bar comes in my script in real time.

I was able to identify whether the 10 minutes bar or 30 minutes bar was close separately by using FirstTickOfBar variable.

But i have some trouble to identify whether 10 minutes and 30 minutes bar closed together or not. I observed that 30 minutes bar close trigger always comes after 10 minutes bar close. But How can I filter out the 10 minutes close trigger? because I don't want my strategy got triggered twice at the same timestamp.

Here is an example. and the trigger that i want to pick up

10:10:00 ---- 10 minutes bar close triggered. I want to pick it up
10:20:00 ---- 10 minutes bar close triggered. I want to pick it up
10:30:00 ---- both 10 minutes and 30 minutes close triggered ( 10 comes first, 30 comes second) but I only want to use 30 minutes close trigger.

How can I filter 10 minutes close trigger out at 10:30:00.

Thanks in advance.

WQL


Started this thread Reply With Quote

Can you help answer these questions
from other members on NexusFi?
CFTC Opens First COT Report Review in 20 Years -- Asks W …
Traders Hideout
CME Group CEO Calls CFTC-Approved Crypto Perps Dangerous …
Traders Hideout
Memorandum Watch: How the 60-Day MOU Framework Makes May …
Prediction Markets & Event Contracts
Four New E-mini Futures Launch June 29 -- Russell 3000, …
Emini and Emicro Index
April FOMC Minutes: Most Divided Fed Since 1992 -- Many …
Traders Hideout
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
NexusFi site changelog and issues/problem reporting
8 thanks
Darmok and Jalad at Tanagra
3 thanks
  #3 (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,669 since Jun 2009
Thanks Given: 33,669
Thanks Received: 102,577


Check out BarsInProgress array, as well as look at Closes (with the s at the end) like Closes[1][0] for the close of BarsInProgress (dataseries) #1 of last bar (0).

Mike




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 X Visit my NexusFi Trade Journal Reply With Quote
Thanked by:
  #4 (permalink)
aaronlee1984
New York
 
Posts: 2 since Jun 2011
Thanks Given: 0
Thanks Received: 0


Big Mike View Post
Check out BarsInProgress array, as well as look at Closes (with the s at the end) like Closes[1][0] for the close of BarsInProgress (dataseries) #1 of last bar (0).

Mike

Thanks Mike, But I think there might still be some problem when the current bar price happens to be the same as the last bar's close price.

Is there something like FirstTickOfBar type of state variable that we can reference? For example, especially in this scenario, if there is something like FirstTickOfBar[0] can be called when 30 minutes bar finished (BarInProgress == 1) , then I think we can probably drop those duplicated 10 minute bars close trigger.

Thanks,

Aaron


Reply With Quote
  #5 (permalink)
 qualitiedx 
sallonika
 
Experience: Beginner
Platform: NinjaTrader
Trading: Forex
Posts: 2 since Jul 2011
Thanks Given: 4
Thanks Received: 0

maybe you could do something like a multiplier that could ignore all action when the 30 min and the 10 min are triggered at the same time...
30 = 3x10...so if nx3x10 return..! n=1,2,....

btw..this is my first post...!!!so, Hello World!


Reply With Quote
  #6 (permalink)
 
cory's Avatar
 cory 
virginia
 
Experience: Intermediate
Platform: ninja
Trading: NQ
Posts: 6,099 since Jun 2009
Thanks Given: 877
Thanks Received: 8,098


pinto552 View Post
Hi Guys,

....

How can I filter 10 minutes close trigger out at 10:30:00.
....

when it's > 20 ?


Reply With Quote
  #7 (permalink)
aaronlee1984
New York
 
Posts: 2 since Jun 2011
Thanks Given: 0
Thanks Received: 0

Hi guys,

I solved it by using BarTimer indicator.

to whoever is facing the same challenges, if you look at the actual algorithm of BarTimer indicator. U can see how it captured bar remaining time for different bar arrays. then just simply copy that part of algorithm into your scripts.

Thanks for all of your help

An


Reply With Quote




Last Updated on September 6, 2011


© 2026 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 - Downloads - Top
no new posts