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)
i have a question about an entry for the strategy that uses 2 algorithms to generate signals.Suppose both algorimths coded to generate a signals on Bar[0].But that`s not always correspond.There are instancies,where the first algo triggers on Bar[1] and the second on Bar[0].So the question is,is there a workaround to add some degree of freedom to the second Algorithm.So if,suppose the X algorithm triggered on Bar[0],how do i get the Y algorithm triggered together with the X,but on any Bars within a certain limit.Example,the X algo triggerd at Bar[0] + the Y algo triggered at any Bars[2]or[1]or[0]or[-1]or[-2] == true
How do i achiev that?
Thanks in advance!
Can you help answer these questions from other members on NexusFi?
I will make some guesses as some of the missing information. I assume you are trying to do this within a single strategy. There is no way to "look ahead" so your [-1] is invalid. I would love it in the next NT to have them give use the future, so what I think you are looking for is to trigger with an AND type of relationship.
When you see the conditions true set a global variable like:
m_ConditionX=true
m_ConditionY=true
then:
if (m_ConditionX && m_ConditionY)
{
enter/exit
}
Be sure to reset the X&Y conditions when you don't think they are valid (true).
Another means would be to simply keep checking for Y when you see X is try. This would be useful if Y is complex and difficult to track. Depending upon what "Trigger" is, there are functions that look back such as MAX(barsback)[0] which you can use to check for Y condition. Difficult to answer in this generic form of a question.
Now,on bar[0] i need the this.super.Values[3][0] be grater or less then the this.super.Values[0][0] set,i.e this.super.Values[0][0] <or> this.super.Values[3][0].