I am new to MQL I am trying to calculate average low for a given timeframe, I know how to do it in TradeScript but not sure about MQL.
TradeScript: (Ref(Low,14)) - would give the 14 day average low
I tried it but the result I was getting vs the TradeScript on the other platform was night and day different.
On a side note when I run my expert in MT4 (back testing) I get good results except at the end date which I take a huge negative is that normal?
22 trades of $120+ each over a year span then -$4747 at close of dates
That may make sense to you, it makes no sense to me.
Trades are being closed with profit which looks good.
You have a lot of losing open floating trades that are only closed at the end of the test which reveals the truth.
HighV = iMA(NULL,0,PERIOD_W1,0,MODE_EMA,5,0)+0.0015;
//------------------------- Above MT4 & Below TradeScript
( LAST < REF(LOW, 14) ) //-------------Buy Command
( LAST > REF(LOW, 5)+.0015) //------------- Sell Command
Correct, but "PERIOD_W1" is One Week expressed in Minutes, namely 10080. So how is 10080 the same as 14?
Even if I try to follow your "logic" how could "One Week" be the same as 14 days?
If TradeScript is new to you, then stop comparing them. Learn MQL from scratch and and learn it as if you had never heard of TradeScript before.