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;
}
}
0>
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;
}
}
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.
This comment has been removed by a blog administrator.
ReplyDelete