Any rookie question, so as not to clutter up the forum. Professionals, don't pass by. Nowhere without you - 6. - page 484

 
borilunad:

I gave up this "genetic algorithm" a long time ago. Mathematics requires precision, and with this genetic algorithm we risk "spilling the baby"! It's better to optimize on opening bars on M1! You'll get better results and save time! There is no point in chasing on ticks, they lie immensely!

I'm not racing on ticks, I am only relying on bar openings. But you can't do it without genetic algorithm either, it will take me about 10 years.
 
366366:

I'm not racing on ticks, only on bar openings. But you can't do it without genetic algorithm either, it will take me about 10 years.

It is necessary to optimize by groups of parameters and with larger steps at first!
 
evillive:



didn't work (( EURUSD,M15: OrderClose error 138

 
miha91:

did not help ((( EURUSD,M15: OrderClose error 138

Is it OK if Sell is closed by Ask?
 

Thanks!!!! so much))))
 
miha91:

Thank you!!!! so much))))
Always a pleasure ;)
 
Zhunko:

Two ways.

1. Read the file into an array. Edit the array as needed, then overwrite the file with this array.

2. Calculate position for the file pointer to the beginning and the end of the data to be rewritten. We read the end part into the buffer and save it. Then we overwrite what was needed. Then we overwrite what we read and remembered earlier from the buffer.


Thank you!!!
 

Can you tell me how to modify a stop and a take order, using an EA as an example? There are DCs that require you to first open an order and then set a take and stop by modification.


//+------------------------------------------------------------------+
//|                                                       martin.mq4 |
//|                      Copyright © 2006, MetaQuotes Software Corp. |
//|                                        http://www.metaquotes.net |
//+------------------------------------------------------------------+
#property copyright "Copyright © 2006, MetaQuotes Software Corp."
#property link      "http://www.metaquotes.net"
 
 
extern int distance=30; 
//+------------------------------------------------------------------+
//| expert initialization function                                   |
//+------------------------------------------------------------------+
int init()
  {
//----
   MathSrand(LocalTime());
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| expert deinitialization function                                 |
//+------------------------------------------------------------------+
int deinit()
  {
//----
   
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| expert start function                                            |
//+------------------------------------------------------------------+
 
int err = 0;
double Lot = 0.1;
double Ballance=0.0;
int start()
  {
//----
   if (OrdersTotal()==0&&err==0)
     {
       if (Ballance!=0.0)
         {
           if (Ballance>AccountBalance())
             Lot=2*Lot;
           else
             Lot=0.1;
         }
       Ballance=AccountBalance();
         
       int order;
       if (MathRand()%2==0) 
         order=OrderSend(Symbol(),OP_BUY,Lot,Ask,5*Point,Bid-distance*Point,Ask+distance*Point);
       else
         order=OrderSend(Symbol(),OP_SELL,Lot,Bid,5*Point,Ask+distance*Point,Bid-distance*Point);
         
 
       
       if(order<0)
         {
           if (GetLastError()==134) 
             {
               err=1;
               Print("NOT ENOGUGHT MONEY!!");
             }
           return (-1);
         }
       //n++;
       
     }
   
   
//----
   return(0);
  }
//+------------------------------------------------------------------+
 
chevalier:

Can you tell me how to modify a stop and a take order, using an EA as an example? There are brokerage companies that require you to first open an order and then modify it to set a take and stop.


Why?
 

Can you tell me if it is possible to calculate a number in the mql4 editor: 108 to the 4096th power.

And if so, how to do it.