Forum

Find the difference

Hello, I got an indicator that is working fine, but I want to reproduce it to a script, and in the scripts I'm getting wrong values. It's a kind of a moving average. In the indicator, ind_buffer0 will have the moving average values. Indicator code int start() { int limit,i; int

Indicator crashing right in the exit of start()

I have an indicator that is crashing Metatrader sometimes, and by using logs, I found out it's happening right when start() ends (it's logging in the last line, and then doesn't log anymore). What does Metatrader do exactly when start() ends? The code is just too big to post it here

CPU usage increases over time

I have an indicator that increases CPU usage over time. At first less than 5%, some hours later 10%, and one day later it's at 50%. Any idea of what is causing it

How to use ShellExecuteA?

I was able to run programs using ShellExecuteA in the previous build. For example to run notepad.exe it was the code below. Now with the new metatrader build it doesn't work anymore... And also file handling is much much slower. #import "shell32.dll" int ShellExecuteA( int hWnd, int lpVerb, string

How to stop indicator from crashing?

This indicator crashes whenever the variable History is larger than the number of bars I have in data history. int start() { //******** TEMPLATE INDICADOR **********/ int i, counted_bars=IndicatorCounted(); i = Bars - counted_bars - 1 ; if (i > History - 1 ) i = History - 1 ;

Build 646: Not getting correct data for the last bar High/Low and volume

This happens in many pairs and the problem doesn't disappear unless I delete the historical data and force MetaTrader to download it again. I've tested in Oanda and Alpari and it happens in both of them: As you can in the 1st one, the last bar (7th May) doesn't show any spread and barely any volume

Metatrader 4 main window doesn't show up, but terminal.exe is running

So I put a lot of charts with an indicator that takes a while to compute everything (2~3 minutes for all charts). Since I closed MetaTrader that time, when I open it the program's window doesn't show up, even though terminal.exe is running. I even changed lastprofile.ini to other standard profiles

Backtesting and bars' highs and lows

When backtesting (using the tick method) the highs and lows on other timeframes get all screwed up. Is there any work-around to resolve this? My EA uses various timeframes at the same time, and it needs the highs and lows to be correct

Why is backtesting starting with a template?

It's starting with a template that has some indicators and I don't know why, why isn't it starting with the default template with just the prices in OHLC like it's usual? It's using a template that has a bugged indicator, which I already changed, but it keeps using the old settings, and so it

My indicator is crashing Metatrader

I have no idea why... There is no problem with the functions isLongTermTrend() and isHigherThan(), because I use them in an EA and they work fine there. //+------------------------------------------------------------------+ //| LongTermTrend.mq4 | //| Tosh | //| |