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 muli time frame strategy that communicates with an indicator. When I back test it, it communicates with the indicator just fine executes trades as expected. I just tried using the Market Replay feature and I am getting some unexpected results. I was wondering if someone could take a look at my code to see if this is the correct way of implementing the communication between strategy and Indicator or if anyone has had trouble testing there strategy with market replay.
In Indicators (both are similar)
In strategy
Can you help answer these questions from other members on NexusFi?
First off just so you're aware, the first two Add(Indicator()) statements are only needed if you want the [visual] indicator to be displayed on the performance results chart.
But your odd behavior is possibly because your if conditions are being applied to each time frame instead of one.
Meaning you'll want to do something like this:
BarsInProgress == 0 or BarsArray[0] is the primary time frame which is set from the NT GUI. You would reference those other time frames individually using BarsArray[] "from within" this primary time frame if using the code above or you would need to reference them using BarsInProgress/BarsArray.
Its been suggested to set your trade execution time frame to 1 second for backtesting purposes or a minimum of 1 minute if you only have minute data and not tick data.
Thanks for the reply MrYou. I am currently checking for BarsInProgress including returning on BarsInProgress==0. The problem I am seeing is at around 5:30am on the ES, I should be getting a buy signal from my indicators and go long. When I backtest, this is what happens. When I use market replay, I get a short signal and I go short. This is very confusing and frustrating for me. My only conclusion is that there is something wrong with Market Replay as my code I believe is sound.