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

 
Ratmirf:

So this is correct?

if (OrderOpenTime()+7200+15*60 <=TimeCurrent()) Cls_Buy=true;

if (OrderOpenTime()+7200+900 <=TimeCurrent()) Cls_Buy=true;

and end up like this?

if (OrderOpenTime()+8100 <=TimeCurrent()) Cls_Buy=true;

Well, it's high school maths... Be a little more confident.
 
harbor:

when the current one is closed, the number of buy orders will decrease, or they will be absent at all (depends on the algorithm), you do this check and delete the pending orders

something like this (in this case, on the contrary, the pending orders are deleted if an earlier placed buy has closed at profit):

Thank you very much. I will look into it tonight.
 

If this happens - I increase Stop Loss to the required size. I don't set threshold, but leave it virtual in the program and open an order. As a result, only one of 15 to 20 orders opens. What should I do to open every order?

RefreshRates();


     double bid = MarketInfo(symbol,MODE_BID);
     double ask = MarketInfo(symbol,MODE_ASK);

    

     double stoplevel =  NormalizeDouble(stoplevelTemp * tickTemp,digitsTemp)+tickTemp;

     if(digitsTemp == 5 )
          stoplevel+=(700 * tickTemp);
     
     if(spreadOrdDangBr < stoplevel)                                                                           //если спред меньше стоплевела - перебиваем
         spreadOrdDangBr=stoplevel;
         
     double lotDB = calculationLot(spreadOrdDangBr,0.0025);                                                      //расчитываем лот - четверть процента свободных денег
     


         slODB=ask-spreadOrdDangBr;                                                                              
         tpODB= ask+ spreadOrdDangBr;

         orderTicketODB=OrderSend(symbol,OP_BUY,lotDB,ask,3,slODB,0,("dangBr" +spreadOrdDangBr));



and as a result in the terminal


 
Hi all) How to determine the maximum price of a selected bar (e.g. 100th bar)
 

Help, please! I want to open Buy position, and if price goes up by 100
pips, my stop loss will become equal to zero relative to the previous stop loss.

Am I doing it correctly?


if(Bid-OrderOpenPrice()>Point*100)

{

OrderModify(OrderTicket(),OrderOpenPrice(), 0,TakeProfit,0,);

return(0);

}

Thank you!

 
Tema97:
Hi all) how to determine the maximum price of a selected bar ( e.g. 100th )
High[100] will not help
 

I found a function that defines the maximum and minimum price for 100 bars and draws horizontal lines (please help me to make the first 15 bars pass and only then check for 100 (how do I make this shift?) and another problem with lines - it draws only 1 time - that is - if we go another 100 points with new highs and lows - the lines are not drawn) anyone know please write down - here is the code

extern inttern Quant_Bars=100; // Number of bars

//--------------------------------------------------------------------

int start() // Special function start

{

int i; // bar number

double Minimum=Bid; // Minimum price

Maximum=Bid; // Maximum price

for(i=0;i<=Quant_Bars-1;i++) // From zero (!) to

{ // ...Quant_Bars-1 (!)

if (Low[i]<Minimum) // If < known

Minimum=Low[i]; // this will be the Min

if (High[i]> Maximum) // if > known

Maximum=High[i]; // it will be max.

}

Alert("For the last ",Quant_Bars, // Display

"Min= ",Minimum," Max= ",Maximum);

double linia1=ObjectCreate("highLine",OBJ_HLINE,0,0,Maximum);

double linia2=ObjectCreate("lowLine",OBJ_HLINE,0,0,Minimum);

return(0); //exit start()

}

 
Tema read the documentation at last. You can find so many interesting things there... For example, iHighest returns the index of the largest found value (shift relative to the current bar) of the corresponding chart. And iHigh returns the value of the maximum price of the bar (specified by the shift parameter) of the corresponding chart. Once you understand these two functions, you can easily solve your problem without resorting to functions that are not always written by others.
 
Guys, if the indicator draws non-standard graphical objects, is it possible to access them? The problem is that they are not displayed in the list of objects (when All button is pressed) and ObjectsTotal() function doesn't see them. When trying to access objects by their name, GetLastError() returns error 4202(ObjectFind() function)
 
tuner:
Guys, if the indicator draws non-standard graphical objects, is it possible to access them? The problem is that they are not displayed in the list of objects (when All button is pressed) and ObjectsTotal() function doesn't see them. When I try to access the objects by their name, GetLastError() returns error 4202 (function ObjectFind())
How does it (the indicator) manage to do this? Can I see the code? What kind of objects and how does it create them...?
Reason: