Q&A

Question 1#
I got a order #130 error when simulate some EA.

Answer:
Some of the codes which show order #130 error, you need to add in below lines and replace with original OrderSend and modify the stoploss and profit take accordingly.

ticketd=OrderSend(currency,OP_BUY,lotnumd,Ask,30,0,0,"My order",16384,0,Green);
OrderSelect(ticketd, SELECT_BY_TICKET); 
OrderModify(OrderTicket(),OrderOpenPrice(),Ask-(50*Point),Ask+(50*Point),0,Blue);

ticketd=OrderSend(currency,OP_SELL,lotnumd,Bid,30,0,0,"My order",16384,0,Green);
OrderSelect(ticketd, SELECT_BY_TICKET); 
OrderModify(OrderTicket(),OrderOpenPrice(),Bid+(50*Point),Bid-(50*Point),0,Blue);



Question 2#
I cannot simulate the EA to get the results

Answer:
You need to set to 3 for simulation mode to run on strategy tester. And set to 1 to run on demo and set 2 to run live trading. This is a fail safe just in case you accidentally loaded the wrong EA.

For modeswitch 1, you can only do demo trading and not live/testing. Please double check your server name.
For modeswitch 2, you can only do live trading and not demo/testing. Please double check your server name (different live server name and different demo server name).
For modeswitch 3, you can only do testing and not demo/live trading.


Question 3#
I got a account number error.

Answer:
You need to set below to run on any account

int accnum = AccountNumber();

Or set to your account number xxxxx below to be account specific

int accnum = xxxxx;



Question 4#
I got pts - variable not defined / I got dev - variable not defined

Answer: 
In put this code at the beginning of the program just after the variable declaration. This will detect the required points and deviation for the ordersend() command
 
  double pts; //replace pts
  double dev; //replace deviation 3

if ((Point==0.00001))  {  pts=0.0001;  dev=30;  }
if ((Point==0.0001)) { pts=0.0001; dev=3; }
if ((Point==0.001)) { pts=0.01; dev=30; }
if ((Point==0.01)) { pts=0.01; dev=3; }



Question 5#
I receive an error code #134

Answer:
Change below codes to reflect lotm which is use for full and mini lot trading account. Refer to your broker the lot size of the trading account. (use 1 for full 100k contract and 0.1 for mini lot of 100k contract.)

   double lotm = 0.1 ; //1 for 1lot = mini lot, 0.1 for 0.1lot = mini lot    
    if (queued==0)   {
      if (AccountBalance()>30000)           { 
      lotnumd=30*lotm;      }
      else     {         intlotnumd=AccountBalance()/1000;
         lotnumd=intlotnumd;
           lotnumd=lotnumd*lotm;       }
      if (AccountBalance()<1000)      {         lotnumd=0.1;      }
    }



Question 6#
I try modify my strategy on your old EA and receive code #130 error.

Answer:
Use TDIF or DRAW mql files to modify and input your trading strategy. Some old EA are without modify order and does not incorporate mini lot, dev and points. Thus giving you error. These old EA files are there for you to use the trading setup rules as reference. (refer to // for other trading strategy codes which are commented).


Change this to suit your strategy setup. Copy such if comparison code to latest version of TDIF or DRAW mql files. (leave the flag number unchange)

if (..... buy setup codes here...)
{
flag=xx;
...
}
if (..... buy setup codes here....)
{
flag=xx;
...
}




Question 7#
There is no trade while I run TDIF. 

Answer:
Please check the spread of the currency. The MT4 simulator will use the current or latest spread bid-ask for your simulation. Alternatively you can adjust the spread to higher then your current bid-ask to allow trades to executed but the results will not be accurate as this spread checking is to ensure the strategy would not trade when big news release which could trigger potential large spread bid-ask.



Question 8#
I want to run the EA on other broker account and number.

Answer:
Please check your broker server name. And modify accordingly. (change email address also). Should you does not want to limit any broker or account no, simply remove these codes.

if (modeswitch==1)    
{
if ((AccountServer()=="InterbankFX-Demo Accounts")||(AccountServer()=="InterbankFX-MT4 Demo Accounts 2"))  { }
else {
  Print("Only Interbank Demo Account is available for demo version");
  Alert("Only Interbank Demo Account is available for demo version");
  Print("Any enquires please contact konika78@yahoo.com");
  Sleep(3600000000);  }
}

if (modeswitch==2)    
{
 if ((AccountServer()=="InterbankFX-MT4 Mini Accounts")||(AccountServer()=="InterbankFX-MT4 Mini Accounts 3")||(AccountServer()=="InterbankFX-MT4 Mini Accounts 4")||(AccountServer()=="InterbankFX-MT4 Mini Accounts 2")){  }
 else {
  Print("Only Interbank Account is available for this version");
  Alert("Only Interbank Account is available for this version");
  Print("Any enquires please contact konika78@yahoo.com");
  Sleep(3600000000); }
...
}


Question 9#
My broker simulated results is different from yours.

Answer: 
History data is different from each broker. You may not get the same result as me but should be similar. Suggest to try demo trading first with your selected broker before trading live. I can't guarantee the results of your trading success.

Also the program will take the spread at that time when you perform the backtesting for your sell and buy trade. If at that point of time, you have a big spread, if will also simulate a different results using the same EA. 



Question 10#
What should be my MT4 expert advisor setting?

Answer: 
You should only tick "Enable Expert Advisor (except for Custom Indicators and Scripts)", "Allow live trading", "Allow DLL imports" and "Allow external experts imports". Refer to picture below.

 

Question 11#
There is no trades. Is my expert advisor (EA) running?

Answer: 
Check that the Expert Advisor button is click with green play icon and top right hand corner of your chart show smiling face. It show the EA is running and pending potential trades to execute.


Also double check your Experts tab, it should show " ... loaded successfully". Your EA is running and scanning continuous looking for potential trades to execute.
 



Question 12#
How to run multiple EA?

Answer: 
Just open a new chart and load 1 EA onto the chart. Using the same MT4 Trading account, you can open many chart and run different EA on each chart. All the EA is design to open and close the designated trade using trade no. (irregardless of currency and chart time period). You just have to calculate the margin required by your trading account leverage and back testing maximum draw down of each EA. For each EA rename a unique filename string textfile = "xxxx.csv";   


Question 13#
How to get historical data for MT4?

Answer: 
Use MT4 terminal program and use the charting to download the old historical data by scrolling to the left side for earlier trading dates. The terminal program will automatically down all the old historical data till the earliest date available from the MT4 server. 

Alternatively, you can download any server M1 historical data (*.hst) and import into your MT4 terminal program and use period convert strip (supplied with the MT4 program) for M5, M15, H1, etc.



 The inputs tab variable ExtPeriodMultiplier is reflecting the minutes. So use 5 value for M5, 15 for M15, 60 for H1 and so on.

 The period_convert will generate HST files for the selected period base on your value for ExtPeriodMultiplier. You can double check it in the program files/MT4/History/Server folder.



Question 14#
How to modify EA to achieve positive results in MT4?

Answer: 
You can use the editor from the MT4 Terminal program which you installed via from your MT4 provider. Below are some factors which you can adjust your trading methodology. 

1) Run EA on different Currency. 
Set string currency = Symbol() if currency is used as a string thru out your EA codes.
or find and change your currency symbol accordingly, etc EURUSD to USDJPY, etc)




2) Run EA on different Time frame (find and change the PERIOD_XX accordingly)
eg, change PERIOD_M5 to PERIOD_M15



3) Change the spread setting
Set double spr = 3;
Change spr accordingly. eg 10 for 10 pips spread to buy/sell trade

or manually find and change ...(Ask-Bid)<=(xxx))... , xxx to your pips value 
(for currency with 5th decimal or Japan currency with 3th decimal, you need to multiply by 10) 


4) Change your profit take and stop loss setting
example below. eg to change 50 pips to 100 pips.

ticketd=OrderSend(currency,OP_BUY,lotnumd,Ask,30,0,0,"My order",16384,0,Green);
OrderSelect(ticketd, SELECT_BY_TICKET); 
OrderModify(OrderTicket(),OrderOpenPrice(),Ask-(50*Point),Ask+(50*Point),0,Blue);

ticketd=OrderSend(currency,OP_SELL,lotnumd,Bid,30,0,0,"My order",16384,0,Green);
OrderSelect(ticketd, SELECT_BY_TICKET); 
OrderModify(OrderTicket(),OrderOpenPrice(),Bid+(50*Point),Bid-(50*Point),0,Blue);

Change
Ask-(50*Point),Ask+(50*Point) to Ask-(100*Point),Ask+(100*Point)
Bid+(50*Point),Bid-(50*Point) to Bid+(100*Point),Bid-(100*Point),


5) Change the strategy entry setting
example.. change the comparing close price and open price from 5 to 10 pips for the respective period.

...(iClose(currency,0,1)<(iOpen(currency,0,1)-5*pts)...

Change to
...(iClose(currency,0,1)<(iOpen(currency,0,1)-10*pts)...


The above can be use in various combination to create different EA trading results.




Question 15#
Notice the program call a xls file which does not comes with the EA program. What is it?

Answer: 
The xls file is created automatically to store account no, trades id, amount, etc and is for memory retention purpose in case you restart the PC, the EA will pick up from where it left automatically.




Question 16#
My EA expired and cannot run anymore.

Please change the expire date (in red) to another year so you can run the EA. This is for putting the product a limited licence date.

  string expire_date = "2028.10.08";

   datetime e_d = StrToTime(expire_date);
   if (CurTime() >= e_d)
   {
      Print("The version has expired! Please contact konika78@yahoo.com");
   Alert("The version has expired!");
   Sleep(360000000);




Question 17#
How to increase the lot size?

The EA comes with standard 3 lot size standard trading. You can adjust it by changing to your desire trading limit. eg 10 standard lot size. Simply change the figure in red. (the smallest trade size is 0.1 standard or 1 mini lot)

      if (AccountBalance()>100000)
      { 
         lotnumd=100*lotm;
      }
      else
      {
         intlotnumd=AccountBalance()/1000;
         lotnumd=intlotnumd;
           lotnumd=lotnumd*lotm;
      }
      if (AccountBalance()<1000)
      {
         lotnumd=0.1;
      }




Question 18#
Which broker is the best?

Answer: 
Different broker provides different spread and reliability. Suggest to try demo trading first with your selected broker before trading live. I can't guarantee the results of your trading success. Good to get a broker with small spread and broker that are regulated.  Alpari UK, IBFX (Now is FXCM AU), AAAfx are some broker I am using.


Question 19#
I get a critical error when trying to run the EA during simulation.

Answer: 
If you are using MT4 build 620 and above, you may encounter a critical error during running because of the divide by zero error value on the symbol currency conversion. Simply delete below codes and compile again in MetaEditor and run your EA in simulation mode.

if ((Symbol()=="EURCHF"))
{
lotr=1/(iClose("USDCHF",PERIOD_H1,1);
}
if ((Symbol()=="EURGBP"))
....
....
....
if ((Symbol()="USDJPYm"))
{
lotr=100/(iClose("USDJPYm",PERIOD_H1,1); //ok
}


Question 20#
I cannot find psycho5 EA as stated in your cook book.

Answer: 
Check sng_psycho5 and you will find it. Some of the EA are name with Sng_ in the front. And ends with a _expire20181008 dates to show that the EA is program to expire after that day. You can simply change it refer to Question 16.

The EA is show in the simulation tester according to increasing alphabetical order A to Z.


Question 21#
While running live account, I notice when my PC restart, the EA load back the excel file details (power failure recovery works) but stay at queued=1 for a very long time.

Answer:
Find the below codes and remove the flag=xx and add in queued==1 (highlighted in blue font).
if (queued==1)  

   if(OrderSelect(ticketd, SELECT_BY_TICKET)==True)
   { ...
and reload your EA again.


Question 22#
What is the maximum EA I can run on my MT4

You can only load 1 EA for any 1 particular currency time chart. However, you can open many currency chart to load different EA. I do not recommend to load more then 10 EA as it will slow down your computer system or VPS.


Question 23#
I want to restrict the EA to only particular currency. How to do it?

Set string currency = Symbol() to your currency used as a string thru out your EA codes.Change the Symbol() to your currency of your choice, EURUSD to USDJPY, etc)



Please email me at sngerge@gmail.com if you face any other problem. Thank you



No comments:

Post a Comment

Top Forex Automated Trading Expert Advisor (EA)


Forex EAROI (Monthly)Profit FactorMax Draw DownS3 ScoresStar RatingAlexa.com
FAP Turbo207%31.770.32%280 points5 starsRank 31,123
GPS Forex Robot28%3.935.68%260 points4 starsRank 283,290
Forex MegaDroid19.8%NANA250 points4 starsRank 72,310
Leo Trader Pro32%2.855.84%250 points4 starsRank 213,570
Forex BulletProof11%1.3219%250 points4 starsRank 309,467
Million Dollar Pips925%2.132.58%240 points4 starsRank 75,635
Forex Growth Bot148%1.669.05%190 points3 starsRank 214,229
Forex Over Drive5.8%NA21%190 points3 starsRank 453,393

Fully editable *.mq4 files that compile successfully with no errors (3MB zip file with 200+ EA codes. Including 40+ strategies from the Strategy Book. You can download the Free Strategy Book by joining my email newsletter on the right side of this website. Click "Buy Now" to make payment and instant down the Best Forex Ranking Cook Book at USD $79 (One time payment only) Click here for more info

Please inform me if unable to purchase or download (send to sngerge@gmail.com)