Announcement

Collapse
No announcement yet.

pinbar

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    pinbar

    Ragazzi buonasera,
    ho trovato un listato in rete e lo modificato per le mie esigenze però mi riconosce solo le pin - bar rialziste non riesco a capire dov'è l'errore, qualcuno mi puoi aiutare, questo è il codice:

    PHP Code:
    int start()
    {
       
    int NeedBarsCounted,  LastBars 0,CountBars=0;
       
    double NoseLengthNoseBodyLeftEyeBodyLeftEyeLength;

       if (
    LastBars == Bars) return(0);
       
    NeedBarsCounted Bars LastBars;
       if ((
    CountBars 0) && (NeedBarsCounted CountBars)) NeedBarsCounted CountBars;
       
    LastBars Bars;
       if (
    NeedBarsCounted == BarsNeedBarsCounted--;

       for (
    int i NeedBarsCounted>= 1i--)
       {
          
    // Won't have Left Eye for the left-most bar
          
    if (== Bars 1) continue;
          
    Pinbar(i);
       }
    }   
    void Pinbar(int idouble MaxNoseBodySize 0.33double NoseBodyPosition 0.4bool   LeftEyeOppositeDirection truebool   NoseSameDirection falsebool   NoseBodyInsideLeftEyeBody falsedouble LeftEyeMinBodySize 0.1double NoseProtruding 0.5
                
    double NoseBodyToLeftEyeBody 1double NoseLengthToLeftEyeLength 0double LeftEyeDepth 0.2)
    {
       
    double NoseLengthNoseBodyLeftEyeBodyLeftEyeLength;
       
    // Left Eye and Nose bars's paramaters
          
    NoseLength High[i] - Low[i];
          if (
    NoseLength == 0NoseLength Point;
          
    LeftEyeLength High[1] - Low[1];
          if (
    LeftEyeLength == 0LeftEyeLength Point;
          
    NoseBody MathAbs(Open[i] - Close[i]);
          if (
    NoseBody == 0NoseBody Point;
          
    LeftEyeBody MathAbs(Open[1] - Close[1]);
          if (
    LeftEyeBody == 0LeftEyeBody Point;

      if (
    Open[i]>Close[i])//Bearish_arrow_Down
       
    {
          if (
    High[i] - High[1] >= NoseLength NoseProtruding// Nose protrusion
          
    {
             if (
    NoseBody NoseLength <= MaxNoseBodySize// Nose body to candle length ratio
             
    {
                if (
    - (High[i] - MathMax(Open[i], Close[i])) / NoseLength NoseBodyPosition// Nose body position in bottom part of the bar
                
    {
                   if ((!
    LeftEyeOppositeDirection) || (Close[1] > Open[1])) // Left Eye bullish if required
                   
    {
                      if ((!
    NoseSameDirection) || (Close[i] < Open[i])) // Nose bearish if required
                      
    {
                         if (
    LeftEyeBody LeftEyeLength  >= LeftEyeMinBodySize// Left eye body to candle length ratio
                         
    {
                            if ((
    MathMax(Open[i], Close[i]) <= High[1]) && (MathMin(Open[i], Close[i]) >= Low[1])) // Nose body inside Left Eye bar
                            
    {
                               if (
    NoseBody LeftEyeBody <= NoseBodyToLeftEyeBody// Nose body to Left Eye body ratio
                               
    {
                                  if (
    NoseLength LeftEyeLength >= NoseLengthToLeftEyeLength// Nose length to Left Eye length ratio
                                  
    {
                                     if (
    Low[i] - Low[1] >= LeftEyeLength LeftEyeDepth)  // Left Eye low is low enough
                                     
    {
                                        if ((!
    NoseBodyInsideLeftEyeBody) || ((MathMax(Open[i], Close[i]) <= MathMax(Open[1], Close[1])) && (MathMin(Open[i], Close[i]) >= MathMin(Open[1], Close[1])))) // Nose body inside Left Eye body if required
                                        
    {
                                         
    High[i] + Point NoseLength 5;
                                         if (
    == 1ObjArrowDown("freccia sell"+TimeToString(Time[1],TIME_DATE|TIME_MINUTES), Time[1], (High[1] + *(Point*10))); //SendAlert("Bearish"); // Send alerts only for the latest fully formed bar
                                        
    }
                                     }
                                  }
                               }
                            }
                         }
                      }
                   }
                }
             }
          }
      }    
      if (
    Open[i]<Close[i])//Bullish_arrow_Up
       
    {    
          if (
    Low[1] - Low[i] >= NoseLength NoseProtruding// Nose protrusion
          
    {
             if (
    NoseBody NoseLength <= MaxNoseBodySize// Nose body to candle length ratio
             
    {
                if (
    - (MathMin(Open[i], Close[i]) - Low[i]) / NoseLength NoseBodyPosition// Nose body position in top part of the bar
                
    {
                   if ((!
    LeftEyeOppositeDirection) || (Close[1] < Open[1])) // Left Eye bearish if required
                   
    {
                      if ((!
    NoseSameDirection) || (Close[i] > Open[i])) // Nose bullish if required
                      
    {
                         if (
    LeftEyeBody LeftEyeLength >= LeftEyeMinBodySize// Left eye body to candle length ratio
                         
    {
                            if ((
    MathMax(Open[i], Close[i]) <= High[1]) && (MathMin(Open[i], Close[i]) >= Low[1])) // Nose body inside Left Eye bar
                            
    {
                               if (
    NoseBody LeftEyeBody <= NoseBodyToLeftEyeBody// Nose body to Left Eye body ratio
                               
    {
                                  if (
    NoseLength LeftEyeLength >= NoseLengthToLeftEyeLength// Nose length to Left Eye length ratio
                                  
    {
                                     if (
    High[1] - High[i] >= LeftEyeLength LeftEyeDepth// Left Eye high is high enough
                                     
    {
                                        if ((!
    NoseBodyInsideLeftEyeBody) || ((MathMax(Open[i], Close[i]) <= MathMax(Open[1], Close[1])) && (MathMin(Open[i], Close[i]) >= MathMin(Open[1], Close[1])))) // Nose body inside Left Eye body if required
                                        
    {
                                           
    Low[i] - Point NoseLength 5;
                                           if (
    == 1)ObjArrowUp("freccia up"+TimeToString(Time[1],TIME_DATE|TIME_MINUTES), Time[1], (Low[1] - *(Point*10)));// SendAlert("Bullish"); // Send alerts only for the latest fully formed bar
                                        
    }
                                     }
                                  }
                               }
                            }
                         }
                      }
                   }
                }
             }
          }
       }
       return(
    0);

Working...
X