[WARNING CLOSED!] Any newbie question, so as not to clutter up the forum. Professionals, don't go by. Can't go anywhere without you. - page 911

 

Hello, people. Has anyone encountered problems with the genetic algorithm? We optimise by genetic algorithm and get the result..... we choose the best one and look at the figure. Then we optimize again on the same interval with the same limits and we get a completely different result.... What is the problem, tell me......

 
Stepan241:

Hello, people. Has anyone encountered problems with the genetic algorithm? We optimise by genetic algorithm and get the result..... we choose the best one and look at the figure. Then we optimize again on the same interval with the same limits and we get a completely different result.... What is the problem, tell me......


Was the terminal disconnected from the internet between optimizations?
 
Stepan241:

Hello, people. Has anyone encountered problems with the genetic algorithm? We optimise by genetic algorithm and get the result..... we choose the best one and look at the figure. Then once again we optimize on the same interval with the same limits and get a completely different result.... What is the matter, tell me......


This method of work gen. algorithm.

Do not use, or use it to define approximate settings. (so I understand there are a lot of variables to optimise.)

 

----- Was the terminal disconnected from the internet between optimisations?

Yes....Optimisation at all on a computer with no internet access...

I'm thinking about NormalizeDouble everywhere

 
Stepan241:

----- Was the terminal disconnected from the internet between optimisations?

Yes....Optimisation at all on a computer with no internet access...

I'm thinking about NormalizeDouble everywhere

I sometimes get different test results because I use my function instead of a slip,

which returns a random number of seconds of delay within the limits I set.

 
Greetings, Does anybody have a 4H Box Breakout_ver.2 Expert Advisor, I heard somewhere that it is not bad, many praise it, I would like to try this wonder? I would like to try it ??? Share if anyone has it please.
 
T.H.C.:

People, please advise! How do I make a position open and close on the expiry of a candle or candlesticks? That is, it opens at the opening of a new candlestick, and closes

How do I take the indicator values at the close of a candlestick?

My question is probably simple, although I am trying to do it myself, but my programming experience is close to zero. Please send me at least an example of some TS that works by this principle.
 

I'm sorry, I can't figure out my "advisor", it chronically gives an error 130 wrong stops, and does not trade. I've set different stops, 10-60 pips, all the same.

//+------------------------------------------------------------------+
//| Dimon's boundaries .mq4 |
//| Copyright © 2010, MetaQuotes Software Corp. |
//| http://www.metaquotes.net |
//+------------------------------------------------------------------+
#property copyright "Copyright © 2010, MetaQuotes Software Corp.
#property link "http://www.metaquotes.net"

//+------------------------------------------------------------------+
//| expert initialisation function |
//+------------------------------------------------------------------+
extern int BandsPeriod=20,i=1 ;extern int BandsShift=0;
extern double BandsDeviations=2.0;
extern double Lots=0.1,TakeProfit=50,stoploss=10;
int init()
{
//----

//----
return(0);
}
//+------------------------------------------------------------------+
//| expert deinitialisation function |
//+------------------------------------------------------------------+
int deinit()
{
//----

//----
return(0);
}
//+------------------------------------------------------------------+
//| expert start function |
//+------------------------------------------------------------------+
int start()
{ int total=OrdersTotal(); Comment(" total ",total); Alert (" total ",total);
if ( total !=0 ){return;}

double Average,Verhnyayaghranytsa,Nyzhnyayaghranytsa,newres,sum,deviation;
string text; int ticket; int err;
text="macd sample";
Average=iMA(NULL,0,BandsPeriod,BandsShift,MODE_SMA,PRICE_CLOSE,i);
//----
newres=Close[i]-Average;
sum=newres*newres;


deviation=BandsDeviations*MathSqrt(sum/BandsPeriod);
Verhnyayaghranytsa=Average+deviation;
Nyzhnyayaghranytsa=Average-deviation;
//----
if (Verhnyayaghranytsa<Close[i])
{ //Comment("buoy!",Verhnyayaghranytsa );
ticket=OrderSend(Symbol(),OP_BUY,Lots,Ask,3,Ask-stoploss*Point,Ask+TakeProfit*Point, "macd sample",16384,0,Green);

}


if (Nyzhnyayaghranytsa>Close[i])
{ //Comment(" sell! ",Nyzhnyayaghranytsa );

ticket=OrderSend(Symbol(),OP_SELL,Lots,Bid,3,Bid+stoploss*Point,Bid-TakeProfit*Point, "macd sample",16384,0,Red);
// Alert (GetLastError();

}
return(0);
}
//+------------------------------------------------------------------+

Right after the start command I check if I have any open orders, and if I do, I exit the start with return; the corresponding strings look like this

int total=OrdersTotal(); Comment(" total ",total); Alert (" total ",total);
if ( total !=0 ){return;}

I think it should work, because my EA does not work properly; total is always 0, alternating with error 130.

Lots, TakeProfit and Stoploss are set accordingly, extern double Lots=0.1, TakeProfit=50, stoploss=10;

I don't understand what's wrong.

Help!!!!!!!!!!!! Please!!!!!!!!!!!!

 
sumotori:


Greetings, Does anybody have a 4H Box Breakout_ver.2 Expert Advisor, I heard somewhere that it is not bad, many praise it, I would like to try this wonder? I would like to try it ??? Share if anyone has it please.

http://forexsystems.ru/sovetniki/26492-poisk-sovetnikov-[kto-ischet-pishem-sdes%60].html

h ttp://www.forexfactory.com/showthread.php?t=168161

 
T.H.C.:
My question may be simple, although I'm trying to do it myself, but my programming experience is close to 0. At least send me an example of some TS, which works according to this principle.


like this

static int KolBars; // this variable stores the number of bars

if ( your condition && Bars != KolBars)

{ // if the number of bars has changed on the screen - opening of a new candle is the condition for taking action

Actions according to the algorithm are done, closing position opening, calculations etc;

KolBars=Bars ; // record the number of bars at which the actions are completed

}

Reason: