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

 

Tried replacing the stops with zeros in the code - the operation is successful. The problem occurs when they are different from zero. In the original (tutorial) they are not normalized. Although I have tried all the variants and this one too.

 
help for a newbie! how can i prescribe the EA to wait for the next bar? i.e. the EA waits for the current bar to be formed and starts checking conditions at the opening of a new bar?
 
warlock писал(а) >>
Help for the newbie! How to prescribe waiting for the EA to open the next bar?

bool f_New_Bar()
{
int Bar_ID=Bars;
bool NB=false;
//+------------------------------------------------------------------+
if (g_NewBar!=Bar_ID)
{
g_NewBar=Bar_ID;
NB=true;
}
return (NB);
}

g_NewBar-global variable.Equals true only on one tick at the start of a new bar

 
VNG писал(а) >>

bool f_New_Bar()
{
int Bar_ID=Bars;
bool NB=false;
//+------------------------------------------------------------------+
if (g_NewBar!=Bar_ID)
{
g_NewBar=Bar_ID;
NB=true;
}
return (NB);
}

g_NewBar-global variable.Equals true only on one tick-at the start of a new bar

Sorri, that's another rush. g_NewBar is an integer variable.

 
warlock писал(а) >>
help newbie! how to prescribe waiting for the next bar? i.e. the EA waits for the current bar to be formed and starts checking conditions at the opening of a new bar?
int start() { 
   if (! NevBar()) return(0);

   CalculateValue();
   Order_Modify();
   Start_OP(OP_BUY);
   Start_OP(OP_SELL);

   return(0);
} 

bool NevBar() {
   static int PrevBar=0;
   int NevBar=Time[0];
   if ( PrevBar== NevBar) return(false);
   PrevBar= NevBar;
   return(true);
}
 
VNG писал(а) >>

Tried replacing the stops with zeros in the code - the operation is successful. The problem occurs when they are different from zero. In the original (tutorial) they are not normalized, although I have tried all variants and this one too.

Perhaps the settings are those of the brokerage company. Try to divide an operation into two.

>> First, we will start with setting of order without stops and takeovers, and then its modification with setting of stops and takeovers.

 
sincerely grateful for your help!
 

Can I make an object "blink" (like the "blink" parameter)?

 
DDFedor >> :

Can I make an object "blink" (like the "blink" parameter)?

Uncle Fyodor, you're asking a lot of questions. I haven't tried it, but I think, you can do it with colour change looping.

But it will be slow and you will need it.

 
Urain писал(а) >>

Well, you're Uncle Fyodor, I have not tried it, but I think that by looping the colour change is possible.

But it'll slow you down, you don't need it.

no... I don't need brakes... during my own studies I do not remember encountering one, so I asked... loops, slips, and delays are not the solution... Thanks!

Reason: