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 think the problem here is that you need an indicator training period, before you can rely on indicators to execute trades. You should therefore code your strategy in a way that
-> indicators are trained during the first N bars
-> and that trades are only executed once the training period has been completed
I typically use two start dates. The first start date for the indicators, and then the second start date for trade execution. I have serialized the start date allowing me to enter two dates in the dialogue box for the strategy.
I am not sure if this helps answer your question, but there is a variable "CurrentBar" built into NT7. This starts out as 0 and increases with each additional bar, so a simple test could be:
if (CurrentBar<50)
return;
Put this at the start of your OnBarUpdate() function and the first time the rest of the code will be executed is on the 51st bar.
Definitely what I was after, thanks for point me in the right direction ...I probably could of figured this out myself, but I've been exhausted this week!
No problem, one of the reasons I like futures.io (formerly BMT), it saves me LOTS of time while coding. Someone on here has almost always solved the problem before me. Good luck.