Welcome to NexusFi: the best trading community on the planet, with over 150,000 members Sign Up Now for Free
Genuine reviews from real traders, not fake reviews from stealth vendors
Quality education from leading professional traders
We are a friendly, helpful, and positive community
We do not tolerate rude behavior, trolling, or vendors advertising in posts
We are here to help, just let us know what you need
You'll need to register in order to view the content of the threads and start contributing to our community. It's free for basic access, or support us by becoming an Elite Member -- see if you qualify for a discount below.
-- Big Mike, Site Administrator
(If you already have an account, login at the top of the page)
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.
WQL
Can you help answer these questions from other members on NexusFi?
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).
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.
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,....
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.