[ARCHIVE]Any rookie question, so as not to clutter up the forum. Professionals, don't pass it by. Can't go anywhere without you - 5. - page 65

 
Vinin:

time out shutdowns

What's a time out? It's not football! :)
 
Macros:

Hi all ! Help me if it is possible to remake ? I want positions to open at the close of a candle below or above the line . Maybe a separate script to add ?



Do on the opening of the candle. You can find a lot of examples. You can start with FAC
 
lottamer:

What's a time out? It's not football! :)

As I understand it, time's up.
 
lottamer:

didn't work.

Well, if it didn't work... WELL OBVIOUSLY A<0 ALL THE TIME THAT'S WHY IT PRINTED 6 GIGS.
 
Vinin:

Do by the opening of the candle. There are many examples to be found. You can start with FAC.

Yes, let's do the opening, in plain language if possible. I'm tired of it...
 
Macros:

Yes, let's go over the opening, in plain language if you can. I'm tired of being a pain in the ass...

Not the best option, but the last post on the page
 
Sepulca:

Well if it didn't work... WELL OBVIOUSLY A<0 ALL THE TIME THAT'S WHY IT PRINTED 6 GIGS.

and <0 is the indicator reading.... can be constant from 10 to 20 minutes.... then it changes... like crossing averages.
 

Good evening! Declared 2 dynamic arrays (so it seems), so-so int Buy[];int Sell[]; And I can't actually assign any value to array elements, printers print zero.

int Buy[];int Sell[];

int start()
  {
//----
    if (!PozyProstavleny){ 
   
           Price= (Ask+Dist*Point) ; TP_BUY=(Price+TP*Point);  SL_BUY= (Price- SL*Point);
           Price_SELL= (Bid-Dist*Point) ;  TP_SELL=Price_SELL-TP*Point;  SL_SELL=Price_SELL+SL*Point; 
           
   for(int Raz1=0;Raz1<Raz;Raz1++){Print ("Raz1",Raz1);
   
           Sleep(2000); RefreshRates();  for(int A=25;A>=0;A--){if(IsTradeAllowed())break;if(A==0)
           Comment(" эксперту не разрешено торговать или поток для выполнения торговых операций занят "); }           
  tyccBuy= OrderSend (Symbol( ), OP_BUYSTOP,  Lot ,NormalizeDouble(Price, Digits), 5, NormalizeDouble( SL_BUY,Digits), 
           NormalizeDouble( TP_BUY,Digits), NULL, 450, 0, CLR_NONE);
   Buy[Raz1]= tyccBuy;Print ("Buy[Raz1]",Buy[Raz1]," tyccBuy",tyccBuy);
           Price= (Price+Dist*Point) ; TP_BUY= (Price+TP*Point); SL_BUY= (Price- SL*Point);
           Error=GetLastError();
     if (Error!=0){ string errorcomment = "Ошибка открытия ордера байстоп  "  + " " + Symbol() +  " " + ErrorDescript(Error); 
           Print (errorcomment);}
           
           Sleep(2000); RefreshRates();  for( A=25;A>=0;A--){if(IsTradeAllowed())break;if(A==0)
           Comment(" эксперту не разрешено торговать или поток для выполнения торговых операций занят "); }        
           Sell[Raz1]=OrderSend (Symbol( ), OP_SELLSTOP,  Lot ,NormalizeDouble(Price_SELL, Digits), 5,
           NormalizeDouble( SL_SELL,Digits),   NormalizeDouble( TP_SELL,Digits), NULL, 450, 0, CLR_NONE);
     Price_SELL= (Price_SELL -Dist*Point) ;TP_SELL=Price_SELL-TP*Point;   SL_SELL=Price_SELL+SL*Point;
            Error=GetLastError();if (Error==0)
            
            {errorcomment = "Ошибка открытия ордера селлстоп  "  + " " + Symbol() +  " " + ErrorDescript(Error); 
        Print (errorcomment);} Print ("for1");PozyProstavleny=1; 
                       }
                       }   
                        

         
             

//----
 

Wearwolf GBPUSD,Daily: Buy[Raz1]0 tyccBuy9

.........

Wearwolf GBPUSD,Daily: Buy[0]0 Buy[1]0 Buy[2]0 Buy[3]0


 
lottamer:

and <0 is the indicator reading.... can be constant from 10 to 20 minutes.... then it changes...like crossing averages


Well, first of all, it's quite realistic to cram 6 gigs in ten minutes. It turns out with every tick one print, why do you need it?

And secondly, are you sure that it changes?

You have to put some kind of semaphore to make it print once...

if ()  {buy}

else { ЕЩЕ_НЕ_ПЕЧАТАЛИ=true; 
 while (a<0) {if(ЕЩЕ_НЕ_ПЕЧАТАЛИ) {print ...; ЕЩЕ_НЕ_ПЕЧАТАЛИ=false;}    a=вычисление_нового_а;}
 ЕЩЕ_НЕ_ПЕЧАТАЛИ=true;
if (...) ... 
somewhere like this....