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

 
Elenn:

"We must, Fedya, we must" (Operation Y).

Then we should call Fedya. I don't know him personally.
 
Elenn:

I need to get the same thing, just for an ordinary trend line. In geometry at school we used to calculate the angle of a triangle with one side for example 3 cm and the other side 5 cm. Here you get 3 pips per 5 bars. I think even our geomancy teacher would be very concerned

Do you want it in seconds, minutes or hours? If in "hours", a few degrees can be discounted. ("Count in hours - get 2 degrees off!")
 
DDFedor:
Do you want it in seconds, minutes or hours? If in 'hours', you can get a discount of a few degrees. ("Count in hours - get 2 degrees off!")

Turns out I do. Didn't think it would work that way.
 

Elenn, the angles are ridiculous to program. They will change in height all the time, depending on the state of the market. Don't tell me that's exactly what you want. Adjust the right side up and down with the mouse, and your angles will change, just as everything changes in height on a scale.

Only the 90 degree angle will not change and that is if the sides are placed on the X and Y axes.

 
It makes sense to measure the angle in terms of units. Also, it is better to measure the tangent and compare it with it. In essence, slope == strength of trend. That's how I do it.
 

Hello.

Can you please tell me if there is an error in my code.

Thank you in advance.

  double LowestPoint_b(int MAGIC)
   {  
    datetime OrdOpenTimeBuy=OrdTimeBuy_b(MAGIC);  
    int ShiftBuy=0;
    double LowestPoint=0;
    if (OrdOpenTimeBuy!=0)
     {  
      ShiftBuy=iBarShift(NULL,PERIOD_M1,OrdOpenTimeBuy,true);
      LowestPoint=iLow(NULL,PERIOD_M1,iLowest(NULL,PERIOD_M1,MODE_LOW,ShiftBuy,0));
     } 
    return(LowestPoint);
   }  
 
nemo811:


Please tell me if there is a mistake in my code.


there is.
 
sergeev:

there is.
If you can, can you at least give us a hint as to what genus they are?
 
function not defined
OrdTimeBuy_b
 
sergeev:
function is not defined

How about this: (???)

//=========== OrdTimeBuy_b(int MAGIC) ===============================================================
//  Функция возвращает время открытия последнего рыночного Buy-ордера, принадлежащего MAGIC или 777 
//---------------------------------------------------------------------------------------------------
datetime OrdTimeBuy_b(int MAGIC)
 {
  string SMB=Symbol();
  int OrdTicketBuy=0;
  datetime OrdOpenTimeBuy=0;
  int i;
  for(i=0;i<OrdersTotal();i++)
   {
    if (OrderSelect(i,SELECT_BY_POS,MODE_TRADES) == true)
     {
      if(OrderSymbol()==SMB)
       {
        if(OrderMagicNumber()==MAGIC || OrderMagicNumber()==777)
         {
          if(OrderType()==OP_BUY)
           {
            if(OrdOpenTimeBuy<OrderOpenTime())
             {
              OrdOpenTimeBuy=OrderOpenTime();
              OrdTicketBuy=OrderTicket();
             }  
           }  
         }  
       }          
     }
   }
   if(OrdOpenTimeBuy==0) return(0);
   if(OrderTicket()!= OrdTicketBuy) OrderSelect(OrdTicketBuy, SELECT_BY_TICKET);
   return(OrdOpenTimeBuy);
 }
//=====================================================================================================


//===========  Локальная низинка  =================================================================
  double LowestPoint_b(int MAGIC)
   {  
    datetime OrdOpenTimeBuy=OrdTimeBuy_b(MAGIC);  
    int ShiftBuy=0;
    double LowestPoint=0;
    if (OrdOpenTimeBuy!=0)
     {  
      ShiftBuy=iBarShift(NULL,PERIOD_M1,OrdOpenTimeBuy,true);
      LowestPoint=iLow(NULL,PERIOD_M1,iLowest(NULL,PERIOD_M1,MODE_LOW,ShiftBuy,0));
     } 
    return(LowestPoint);
   }  
//=================================================================================================
Reason: