Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

Partner 728x90

Collapse

Close bar recognization in multi time frame strategy

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Close bar recognization in multi time frame strategy

    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

    #2
    Hello WQL,

    Thanks for the post and welcome to the NinjaTrader forums.

    You can use BarsInProgress filter to define context of updates.

    if (BarsInProgress == 0 && FirstTickOfBar)

    if (BarsInProgress == 1 && FirstTickOfBar)

    Ryan M.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by tierraany, Today, 01:06 AM
    0 responses
    2 views
    0 likes
    Last Post tierraany  
    Started by Wilmarobyi, Today, 12:48 AM
    0 responses
    3 views
    0 likes
    Last Post Wilmarobyi  
    Started by BackToTheFutures, 08-17-2021, 03:15 PM
    8 responses
    732 views
    0 likes
    Last Post joehanus  
    Started by elirion, Yesterday, 09:32 PM
    0 responses
    8 views
    0 likes
    Last Post elirion
    by elirion
     
    Started by cre8able, Yesterday, 09:15 PM
    1 response
    8 views
    0 likes
    Last Post bltdavid  
    Working...
    X