[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 455

 
AccountBalance()*0.05
 
keekkenen >>:
AccountBalance()*0.05

Thank you!

 
sergeev писал(а) >>

No script can open the terminal!

So if you want it to work, it must be on a terminal that is open and connected to the net. It will run at the required time and record the data. But terminals must be always switched on.

The terminal is on VPS and the Expert Advisor is working clearly connected to the Internet.

I'm not exactly a 7-month-old.

I have no idea what to do with it.

 
Could you please give us a link to a code example for fixing the global variable, taking into account the time when the EA was turned on.
We need the global variable to be fixed at the start of the EA, and then when the EA closes all orders, it should be rewritten and remain unchanged until the end of the cycle.
 
Nail_Saby писал(а) >>
Could you please give us a link to a code example for fixing the global variable, taking into account the time when EA was turned on.
The global variable needs to be fixed at the start of the EA, and then when the EA closes all orders, it will be overwritten and remain unchanged until the end of the cycle.

https://book.mql4.com/ru/variables/globals

 
Thank you, I've seen that before.
 

Can you tell me where the error lies?

I can't get a pause.


int start()

{

Print ("Falling asleep");
Sleep(10000);
Print ("Waking up");

return(0);

}


The result, judging by the image, is pause = 0.



 

baltik писал(а) >>

The script, when executed, makes a history file in the folder eksert\philes\ file name (this is the account number)

I need to get away from manual execution of the script.

Make it an Expert Advisor instead of a script and control the time of script function-code execution in the Expert Advisor. It's time - execute script code.

So we don't need to open the terminals

I have understood from this phrase, that your terminals are closed. I'm answering you - the script cannot start the terminal by itself.

As you write it, that's how it is understood. If this is not what you mean, explain more clearly.

I'm sorry no I'm just looking for some help :)

and you're left with my idea of running the script

What is the value of the idea? If it were so necessary, some proger would not have tweaked the case long ago ... it's for you personally.

 
MoneyJinn >>:

Подскажите где ошибка.

Никак не удается получить паузу.


В результате судя по картинке пауза = 0.

Is it in the indicator? in the Sleep indicators doesn't work.

 

Hi all ! Help me out with the code of the indicator, I can't fix it myself :(

code:

#property copyright "Copyright © 2010,"
#property link      ""

#property indicator_separate_window
#property indicator_buffers 1
#property indicator_color1 DodgerBlue
double Avar[];
double Clos[];
//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int init()
  {
//---- indicators
   IndicatorBuffers(2);
   SetIndexStyle(0,DRAW_HISTOGRAM);
   SetIndexBuffer(0, Avar);

   SetIndexBuffer(1, Clos);
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| Custom indicator deinitialization function                       |
//+------------------------------------------------------------------+
int deinit()
  {
//----
   
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| Custom indicator iteration function                              |
//+------------------------------------------------------------------+
int start(){
   int    counted_bars=IndicatorCounted();
   int limit=Bars- counted_bars;
      for(int i= limit-1; i>0; i--){
         Clos[ i]=iClose(NULL,0, i)-iClose(NULL,0, i+1);
      }
   ArrayInitialize( Avar,0);
      for( i=2; i<Bars; i++){
         if(MathAbs( Clos[1])==MathAbs( Clos[ i])){
            Avar[ i]= Clos[ i];
            Avar[1]= Clos[1];
            break;
         }
      }
  
  
  
   return(0);
  }
//+------------------------------------------------------------------+

It outputs 2 histograms, I need the leftmost histogram - to stretch up to the right. if the desired condition is no longer fulfilled, and there is already a left histogram. as in the figure ( in yellow ...), please help me to correct.


Reason: