[ARCHIVE] Any rookie question, so as not to clutter up the forum. Professionals, don't pass by. Nowhere without you - 3. - page 200

 
Good evening all! Please tell me how to write a piece of code, condition - if High[1]-Low[1]> High[2]-Low[2] then BUY. I understand that this must be written using NormalizeDouble(). Thanks in advance.
 
Can you tell me which loop can go through all the values of a double (price) one-dimensional array with BPs dimension to zero out its values by condition, THANK YOU!
 
isaev-av:
Good evening all! Please tell me how to write a piece of code, condition - if High[1]-Low[1]> High[2]-Low[2] then BUY. I understand that this must be written using NormalizeDouble(). Thanks in advance.

NormalizeDouble is absolutely unnecessary in this condition.
 
Operr:
Can you tell me which loop can go through all the values of a double (price) one-dimensional array with BPs dimension to zero out its values by condition, THANK YOU!

what loops do you know ?
 

about horizontal lines


avatar
5
yllh2005 21.09.2011 21:47

Help, please!

How do I draw horizontal lines that represent the lowest price and the highest price for the day?

 
sergeev:

What cycles do you know?
for and while, but ask another way, the array has price level values ExtUpFractalsBuffer[], only the broken levels need to be deleted
 
sergeev:

NormalizeDouble is completely unnecessary in this condition.

Then tell me how to do it right. Or at least give me a link to some Expert Advisor to see an example.
 
isaev-av:

Then tell me how to do it right. Or at least give me a link to some Expert Advisor to see an example.
Examples can be found in any Expert Advisor, in half of them for sure. Somehow, of course undefined variables need to be declared, initialized and error handling of opening to taste.
int ticket;
if (High[1]-Low[1]> High[2]-Low[2])
{
   ticket=OrderSend(Symbol(),OP_BUY,Lot,NormalizeDouble(Ask,Digits),3,NormalizeDouble(Ask-StopLoss*Point,Digits),NormalizeDouble(Ask+TakeProfit*Point,Digits),OrderComment,Magic,0,Green);
   if(ticket<0)
   {
      Print("OrderSend failed with error #",GetLastError());
      return(0);
   } 
}

 
Operr:
for and while, but my question is different. The array contains price levels ExtUpFractalsBuffer[], I need to delete only the broken levels


It didn't get any clearer. As I understand it, but variations are possible (especially with broken levels and fractals):

for (int i=0; i<Bars; i++)
{
 if(array[i]<PriceLevel) array[i]=0;
}

Maybe you're just looking for support and resistance levels, there's plenty of them. I had a good turndown from Vinin, mine should be around somewhere here and there are dozens if not hundreds of them.

 
Figar0:
Examples in virtually any EA, half of them for sure. Something like this, of course undefined variables need to be declared, initialized and error handling opened to taste.

Thank you. And Digits should be changed to 4 or 5, depending on DC?
Reason: