Why is there NO Complete EA within the Code-Base?

Back to topics list  | 1 2 3 4 To post a new topic, please log in or register
avatar
285
szgy74 2013.08.11 23:20 #
 

Some things to add as EA options:

- unique magic number calculation, maybe foolproof to give the same result when broker changes symbol name (for example from "EURUSD" to "EURUSD.m")

- order management options (trailing stop, break even (these in pips or other values like psar, x bars high/low, ma, etc.), order close)

- extensive order info handling by order ticket (for which a text (or csv) file seems to be the simplest appropriate way). GV is limited, OrderComment() may be changed by the broker.

 
avatar
12985
WHRoeder 2013.09.25 15:15 #
 
Building on IsNYOnDst
datetime TimeSrvToNY(datetime timeSrv=EMPTY){      // Server time to NY time
   if(timeSrv == EMPTY) timeSrv = timeCur_srv;
      #define NY_TZ_STD -5                   // NY is UTC-5 (STD) or UTC-4 (DST)
   int utcToNY = NY_TZ_STD + IsNYonDST(timeSrv);
   return(TimeSrvToUTC(timeSrv) + utcToNY * 3600);  // Previous called TimeGMT
}
datetime TimeNyToSrv(datetime timeNY){
   int utcToNY = NY_TZ_STD + IsNYonDST(timeNY);
   return( TimeUtcToSrv(timeNY - utcToNY * 3600) ); // Previous called TimeServer
}

avatar
155
4x4ever 2014.01.22 23:02 #
 
WHRoeder, are you updating the download link or do we need to manually "patch" the WHRea source with all the updates that you provide in this thread?

avatar
12985
WHRoeder 2014.01.22 23:38 #
 
You can't update posts once they become a couple of days old.
avatar
155
4x4ever 2014.01.23 17:14 #
 
I see.. Would you please post the most recent version here again then?
avatar
1146
flaab 2014.04.13 14:16 #
 
mbirrell:

I am a bit worried about sharing my custom indicators and EAs because if I did and everyone started using them they wouldn't work any more... Does anyone else agree?

I know this sounds a bit selfish... but when I get to 5 million I will share ;-)

Actually if everyone used your Ea, the market price will either be zero or infinite. Everyone will want to buy or sell at the same time.

avatar
23
mideel 2015.04.21 15:32 #
 

Hello guys, is the example in MQL4 tutorial just enough if we only want simple and general solution ?

My EA trade and do calculation per bar and not per tick.


int Fun_Error(int Error)                        // Function of processing errors
  {
   switch(Error)
     {                                          // Not crucial errors           
      case  4: Alert("Trade server is busy. Trying once again..");
         Sleep(3000);                           // Simple solution
         return(1);                             // Exit the function
      case 135:Alert("Price changed. Trying once again..");
         RefreshRates();                        // Refresh rates
         return(1);                             // Exit the function
      case 136:Alert("No prices. Waiting for a new tick..");
         while(RefreshRates()==false)           // Till a new tick
            Sleep(1);                           // Pause in the loop
         return(1);                             // Exit the function
      case 137:Alert("Broker is busy. Trying once again..");
         Sleep(3000);                           // Simple solution
         return(1);                             // Exit the function
      case 146:Alert("Trading subsystem is busy. Trying once again..");
         Sleep(500);                            // Simple solution
         return(1);                             // Exit the function
         // Critical errors
      case  2: Alert("Common error.");
         return(0);                             // Exit the function
      case  5: Alert("Old terminal version.");
         Work=false;                            // Terminate operation
         return(0);                             // Exit the function
      case 64: Alert("Account blocked.");
         Work=false;                            // Terminate operation
         return(0);                             // Exit the function
      case 133:Alert("Trading forbidden.");
         return(0);                             // Exit the function
      case 134:Alert("Not enough money to execute operation.");
         return(0);                             // Exit the function
      default: Alert("Error occurred: ",Error);  // Other variants  
         return(0);                             // Exit the function
     }
  }

Back to topics list   | 1 2 3 4  

To add comments, please log in or register