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 cory with 1 posts (0 thanks)
    3. looks_3 pinto552 with 1 posts (0 thanks)
    4. looks_4 qualitiedx with 1 posts (0 thanks)
    1. trending_up 3,731 views
    2. thumb_up 1 thanks given
    3. group 5 followers
    1. forum 6 posts
    2. attach_file 0 attachments




 
Search this Thread

Close bar recognization in multi time frame strategy

  #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?
Pivot Indicator like the old SwingTemp by Big Mike
NinjaTrader
Trade idea based off three indicators.
Traders Hideout
How to apply profiles
Traders Hideout
Better Renko Gaps
The Elite Circle
REcommedations for programming help
Sierra Chart
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Just another trading journal: PA, Wyckoff & Trends
34 thanks
Tao te Trade: way of the WLD
24 thanks
My NQ Trading Journal
14 thanks
Vinny E-Mini & Algobox Review TRADE ROOM
13 thanks
GFIs1 1 DAX trade per day journal
11 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,440 since Jun 2009
Thanks Given: 33,212
Thanks Received: 101,599


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 Twitter 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,098 since Jun 2009
Thanks Given: 877
Thanks Received: 8,090


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


© 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