I just want to point out that on the chart I posted the Blue line is the "MainTrend" and is the one that gives the incorrect reading in the Strategy
Tester as well as in a Demo account. The magenta line is for the "length" parameter instance and seems to give accurate readings. The
mystery is why would one give reasonably accurate readings and the other one not and it is only the "length"' parameter that is different. On
the chart the line is drawn in the correct place and the data also appear correct in the data Window. It is just the values in the Strategy Tester
and demo account that is given differently.
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
I have written an EA using among others the well known custom indicator called NonLagMA. I have written other EA's with this indicator without any problems that i was aware of at that time. I have two different length parameters that each are linked to either a Bull or Bear trend. I use two different Length parameters (Length & MainTrend). My readings for the one instance of the indicator with the Length parameter seems reasonably correct but the reading of the other one with the MainTrend length parameter is way out and causes the EA to post incorrect trades. This is what the snippet of code looks like:
As you can see from the following chart I have drawn a vertical line where the SELL transaction was activated (Shift = 1). But the "MainTrend" is showing Bullish on the chart as well as the Data Window.
So the SELL transaction should never have been activated. If we look at the Journal we see that the "MainTrend" is there shown as Bear which is opposite to the chart and Data Window and that is why the SELL transaction was incorrectly activated. Here is a small extract from the Journal for that specific time:
Please help me to solve this riddle!