NexusFi: Find Your Edge


Home Menu

 





N Bars Before And After Signal


Discussion in NinjaTrader

Updated
    1. trending_up 1,614 views
    2. thumb_up 1 thanks given
    3. group 2 followers
    1. forum 3 posts
    2. attach_file 0 attachments




 
Search this Thread

N Bars Before And After Signal

  #1 (permalink)
 
Cachevary's Avatar
 Cachevary 
Russia,Khabarovsk
 
Experience: Beginner
Platform: NT
Trading: Gold
Posts: 407 since Feb 2014

Hey C# Guys,

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!

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
ZombieSqueeze
Platforms and Indicators
Better Renko Gaps
The Elite Circle
NT7 Indicator Script Troubleshooting - Camarilla Pivots
NinjaTrader
MC PL editor upgrade
MultiCharts
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Funded Trader platforms
67 thanks
Trading with Intuition
15 thanks
Self sabotage reframed
15 thanks
GFIs1 1 DAX trade per day journal
14 thanks
Just another trading journal: PA, Wyckoff & Trends
13 thanks
  #3 (permalink)
 
NJAMC's Avatar
 NJAMC 
Atkinson, NH USA
Market Wizard
 
Experience: Intermediate
Platform: NinjaTrader 8/TensorFlow
Broker: NinjaTrader Brokerage
Trading: Futures, CL, ES, ZB
Posts: 1,970 since Dec 2010
Thanks Given: 3,037
Thanks Received: 2,395



Cachevary View Post
Hey C# Guys,

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!

Hi @Cachevary,

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.

Nil per os
-NJAMC [Generic Programmer]

LOM WIKI: NT-Local-Order-Manager-LOM-Guide
Artificial Bee Colony Optimization
Visit my NexusFi Trade Journal Reply With Quote
Thanked by:
  #4 (permalink)
 
Cachevary's Avatar
 Cachevary 
Russia,Khabarovsk
 
Experience: Beginner
Platform: NT
Trading: Gold
Posts: 407 since Feb 2014

Hello guys,

need assistance in building conditions.

I have:


 
Code
(this.super.Values[0][1] == this.super.Values[3][1] || this.super.Values[1][1] == this.super.Values[3][1] || this.super.Values[2][1] == this.super.Values[3][1])
I need this.super.Values[3][1] to be equal to any other of the 3 sets when on Bar[1].

Suppose there were the following sets that matched:

this.super.Values[0][1] == this.super.Values[3][1]

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].

How do i accomplish that?Please advise!

Thank you.

Started this thread Reply With Quote




Last Updated on January 22, 2015


© 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