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
Please read my last post guys where I have reached a conclusion that shows a quirk in the MT4 interpreter when running. My inefficient code shows the problem but it shouldn't create it or be there in the first place. Is it because I only have 2GB that it occurs?
Ruptor:
By editing the indicator so it only goes back a couple of bars further than period of the longest MA it uses the EA now runs very fast.
What doesn't make sense is that the trigger that makes the EA go slow does not change the number of times the indicator is called it just does a bit of extra code when in a trade.
In normal operation on a live chart I know the indicator code only uses the latest tick and does not load all the bars but in a backtest it can't work like that because it is reloaded on every call. Therefore indicators have to be specially written for use in EAs so they only load the bars they need.
WHR I am confused now and still nothing about how the problem occurs makes sense. Yes it looks like the indicator is loading all bars but I have fixed that in my own way and it solves the problem. However are you saying that iCustom called inside an EA never happens after the first call? The question still stands as to why does the code only go slow when I select to use my own trailing stop that doesn't have anything to do with the only call of iCustom in the code that makes the trade decision? If the indicator does go reload all bars on every tick wouldn't it redraw the chart every time? I thought the indicator was correct because it uses the standard example code and it doesn't slow my platform when it is put on a chart. Here is the bar calculation part of the indicator that must have a problem but I can't see it.
AMA0=Open[pos+1];
Means your lookback is one. Fix your loop properly.