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)
This is my first post and I am just learning Ninjascript. I am working on a strategy that uses SbSRenko(5) as a primary Bar chart and SbSRenko(20) as a secondary.
In Initialize() I try to add the SbSRenko first and then the SbSRenko(20):
I am certainly not an expert yet with "Multi-timeframe" strategies but I can tell you the INIT you don't need the primary set in your chart type. Just add the 20 not the 5. 5 will be BarsInProgress==0 and 20 will then be BarsInProgress==1.
I am not sure your conditional statements are valid. You should probably use a construct more like:
If (BarsInProgress==0)
{// Put all sb=5 conditions,etc here
m_EMA5=EMA(Close,myperiod);
}
If (BarsInProgress==1)
{// Put all sb=20 conditions,etc here
m_EMA20=EMA(Close,myperiod);
}
Also note in your logic that if both bars close at the same time, BarsInProgress==0 will aways fire first. You should be able to use all the Open/Close/High/Low/Volume datasets and NT sets them to the appropriate data set. It uses BarsInProgress to tell you which data set they are currently point.