Close bar recognization in multi time frame strategy
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.
Please register on futures.io to view futures trading content such as post attachment(s), image(s), and screenshot(s).
Check out BarsInProgress array, as well as look at Closes (with the s at the end) like Closes for the close of BarsInProgress (dataseries) #1 of last bar (0).
Due to time constraints, please do not PM me if your question can be resolved or answered on the forum.
Need help? 1) Stop changing things. No new indicators, charts, or methods. Be consistent with what is in front of you first. 2) Start a journal and post to it daily with the trades you made to show your strengths and weaknesses. 3) Set goals for yourself to reach daily. Make them about how you trade, not how much money you make. 4) Accept responsibility for your actions. Stop looking elsewhere to explain away poor performance. 5) Where to start as a trader? Watch this webinar and read this thread for hundreds of questions and answers. 6) Help using the forum? Watch this video to learn general tips on using the site.
If you want to support our community, become an Elite Member.
The following user says Thank You to Big Mike for this post:
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 can be called when 30 minutes bar finished (BarInProgress == 1) , then I think we can probably drop those duplicated 10 minute bars close trigger.
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.