Skip to main content

Evolve Expert Advisor Codes

NOTE! DO NOT USE THIS FOR REAL MONEY! THIS IS NOT TESTED! THIS SHOULD BE USE FOR DEMO PURPOSES!

I had being thinking about this idea for awhile now, what if i can take a bunch of EA and randomly add in codes/indicator and see which one do the best and using that EA as a base and create another generation of EAs?

My first EA is going to be a simple bot that will base on a random number 1 to 100 to buy or sell. As this is totally random, i dont see how it can randomly generate profit. But i had seem well made technical report totally ruin in the market. So being a totally random EA might have its random advantages.

Codes
static int LowRisk_ticket;
  if(OrderSelect(LowRisk_ticket, SELECT_BY_TICKET)==false){
   MathSrand(GetTickCount());
   double rand1 = 1*MathRand()/32768.0;
   MathSrand(GetTickCount());
   double rand2 = 1*MathRand()/32768.0;
   MathSrand(GetTickCount());
   double rand3 = 1*MathRand()/32768.0;
   if (rand1 ==0) rand1 = 1*MathRand()/32768.0;
   if (rand2 ==0) rand2 = 1*MathRand()/32768.0;
   if (rand3 ==0) rand3 = 1*MathRand()/32768.0;
   if (rand1 ==0) rand1 = 1*MathRand()/32768.0;
   if (rand2 ==0) rand2 = 1*MathRand()/32768.0;
   if (rand3 ==0) rand3 = 1*MathRand()/32768.0;
  if(profitOrLost>0)
   {
      if (tradeType==1)
      {
         LowRisk_ticket=OrderSend(Symbol(),OP_BUY,LowRisk_Lots,Ask,3,Bid-(rand1),Bid+(rand2),"buy Order",16384,0,Red);
      }
      if (tradeType==0)
      {
         LowRisk_ticket=OrderSend(Symbol(),OP_SELL,LowRisk_Lots,Bid,3,Ask+(rand2),Ask-(rand1),"buy Order",16384,0,Red);
      }
   }
   if(profitOrLost<=0)
   {
      if (rand3<0 .5="" p="">       LowRisk_ticket=OrderSend(Symbol(),OP_BUY,LowRisk_Lots,Ask,3,Bid-(rand1),Bid+(rand2),"buy Order",16384,0,Red);
       tradeType=1;
      }
      if (rand3>0.5){
       LowRisk_ticket=OrderSend(Symbol(),OP_SELL,LowRisk_Lots,Bid,3,Ask+(rand2),Ask-(rand1),"buy Order",16384,0,Red);
       tradeType=0;
      }
     }
  }
  if(OrderSelect(LowRisk_ticket, SELECT_BY_TICKET)==true){
   if (OrderCloseTime()!=0)
   {
   //Order is closed
      profitOrLost=OrderProfit();
      LowRisk_ticket=0;
   }
  }


Question: What is an Expert Adviser?
Answer:
An Expert Adviserpiece of software written specifically for the MetaTrader Platform. An Expert Adviser an just advise traders which trades to make or can be programmed to automatically execute the trades on a live account.
Expert Adviser re very flexible pieces of software that can take any information into account that is available on the metatrader platform. They are written in their own proprietary programming language called Adviser Language Version 4.

Comments

  1. This comment has been removed by a blog administrator.

    ReplyDelete

Post a Comment

Popular posts from this blog

Today's Forex Focus, 30 Jan 2024

 Ah, nephew, let's dive into the Forex market today, shall we? It's like peering into a crystal ball, but with a bit more logic and a lot less mysticism. First up, we've got the EUR/USD pair showing a bit of a bearish tilt. The dollar's holding steady like a rock in a stream, buoyed by investors who've got their eyes glued to the upcoming Federal Reserve policy meeting. There's a bit of a buzz about geopolitical tensions in the Middle East, making investors a bit jittery and giving the dollar a bit of a boost​​. Then, there's talk about the Federal Reserve potentially pushing back against the idea of a rate cut anytime soon. This is like a plot twist in a thriller movie for the traders, who are now less convinced about a rate drop in March. The dollar, meanwhile, is flexing its muscles a bit, up by 0.19% against a basket of currencies. Across the pond, the Euro's taken a bit of a tumble, and there's chatter about when the European Central Bank might ...

Kindle Paperwhite

First-Ever Paperwhite Display Brilliant Resolution Our Paperwhite display offers 62% more pixels, and renders exceptionally sharp, clear text and images. Stunning Contrast Kindle Paperwhite's screen has 25% higher contrast. Crisp, dark text against a brilliant white background makes for the perfect read. Innovative Built-in Light Paperwhite guides light towards the display from above instead of projecting it out at your eyes like back-lit displays, thereby reducing screen fatigue. You can adjust your screen's brightness to create a perfect reading experience in all lighting conditions, from bright sunlight to bedtime reading. Uncompromised Battery Life A single charge lasts up to eight weeks, based on a half hour of reading per day with wireless off and the light setting at 10. Our breakthrough power management technology allows you to leave the light on at all times for the best possible contrast without sacrificing battery life. Read ...

Is Currency Carry Trade worth investing?

  What is Currency Carry Trade? "A strategy in which an investor sells a certain currency with a relatively low interest rate and uses the funds to purchase a different currency yielding a higher interest rate. A trader using this strategy attempts to capture the difference between the rates, which can often be substantial, depending on the amount of leverage used. " quoted from http://www.investopedia.com/terms/c/currencycarrytrade.asp Value?  The value of this investment depend on the currency being used. Since most high interest currency belong to third world countries, their currency tend to be very unstable. For example Argentina which have an interest rate of 8.18%(at the time of this post) but due to it the 2014 Aug Default, no sane investor would consider getting this bond. If the trader get the safer developed countries currency, the interest rate tend to be lower. So in order to get the same return as third world countries, the trader would need to leve...