- [Archive!] Any rookie question, so as not to clutter up the forum. Professionals, don't pass it by. Couldn't go anywhere without you - 2.
- Any questions from newcomers on MQL4 and MQL5, help and discussion on algorithms and codes
- Any rookie question, so as not to clutter up the forum. Professionals, don't pass by. Nowhere without you - 6.
int GetSignal(int &major) { major = -1; double st11 = iCustom(NULL, 0, ST, MajorPeriod, MajorFactor, 0, 1); double st21 = iCustom(NULL, 0, ST, MajorPeriod, MajorFactor, 1, 1); double st12 = iCustom(NULL, 0, ST, MajorPeriod, MajorFactor, 0, 2); double st22 = iCustom(NULL, 0, ST, MajorPeriod, MajorFactor, 1, 2); double ma = iMA(NULL, 0, MaPeriod, 0, MaMethod, MaApplied, 1); double mapr = iCustom(NULL, 0, map, MaPeriod, MaMethod, MaApplied, 0, 1); if (st11!=EMPTY_VALUE) major = OP_BUY; if (st21!=EMPTY_VALUE) major = OP_SELL; st11 = iCustom(NULL, 0, ST, MinorPeriod, MinorFactor, 0, 1); st21 = iCustom(NULL, 0, ST, MinorPeriod, MinorFactor, 1, 1); st12 = iCustom(NULL, 0, ST, MinorPeriod, MinorFactor, 0, 2); st22 = iCustom(NULL, 0, ST, MinorPeriod, MinorFactor, 1, 2); if (major==OP_BUY && st11!=EMPTY_VALUE && st12!=EMPTY_VALUE && st22!=EMPTY_VALUE && Close[1]<ma && mapr>=MaTriggerPercent) return (OP_SELL); if (major==OP_SELL && st21!=EMPTY_VALUE && st22!=EMPTY_VALUE && st12!=EMPTY_VALUE && Close[1]>ma && mapr>=MaTriggerPercent) return (OP_BUY); return (-1); }
Your EA requires "ST.ex4" and "MaPercent.ex4". Able to also attach these indicators so that helpers can test?
The EA will only fire a trade if the rule conditions in GetSignal method are satisfied.
Your EA requires "ST.ex4" and "MaPercent.ex4". Able to also attach these indicators so that helpers can test?
The EA will only fire a trade if the rule conditions in GetSignal method are satisfied.
What are the EA settings you are testing on? Please supply.
You can also run the Strategy Tester on a narrower time period by configuring the Use Date From and To with To as today.
What are the EA settings you are testing on? Please supply.
You can also run the Strategy Tester on a narrower time period by configuring the Use Date From and To with To as today.For
Just to test if the EA works, i use this settins. This will make the most trades and almost trade 24/4.
I really apreciate that you try to help me
You can save the EA settings using the save button.
And by the way, I am not sure if you want to use this EA as it hits my free margin alert on back testing even though it is a $10,000 account.
Seems to fire lots of trades and might have high drawdown.
What is your leverage used?
You can save the EA settings using the save button.
And by the way, I am not sure if you want to use this EA as it hits my free margin alert on back testing even though it is a $10,000 account.
Seems to fire lots of trades..
Sorry may i know what is your account leverage? There is a free margin alert on my account as i use a lower leverage.
Okay no problem using backtester on 1:500.
What time frame are you testing on?
void OnTick() { //------------------------------------------------------------------ if (!IsConnected() || AccountNumber() == 0 || Bars <= 30 || ArraySize(Time) == 0) return; //------------------------------------------------------------------ if (lastCandle != Time[0]) { lastCandle = Time[0]; Signal = GetSignal(MajorTrend); } //------------------------------------------------------------------ if (MajorTrend==OP_SELL && IsAnyOrderActive(OP_SELL)!=-1) CloseAllOrders(OP_SELL); if (MajorTrend==OP_BUY && IsAnyOrderActive(OP_BUY)!=-1) CloseAllOrders(OP_BUY); if (Signal!=-1 && CheckTime() && DoesSignalCatched(Signal, Time[0])==-1 && (MaxTrades==0 || GetOrderCount(-1)<MaxTrades)) SetOrder(Signal); else Signal = -1; //------------------------------------------------------------------ ManageOrders(); //------------------------------------------------------------------ }
If you see the code, it requires 30 bars to be available before it trades. So if it is D1, it requires 30 days
You can put debugging statements there at the check statements to see what is wrong with your account environment.
Okay no problem using backtester on 1:500.
What time frame are you testing on?
If you see the code, it requires 30 bars to be available before it trades. So if it is D1, it requires 30 days
You can put debugging statements there at the check statements to see what is wrong with your account environment.
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use