Skip to content

Instantly share code, notes, and snippets.

@chew-z
Last active August 29, 2015 14:08
Show Gist options
  • Save chew-z/2632a5fac75086aed9f5 to your computer and use it in GitHub Desktop.
Save chew-z/2632a5fac75086aed9f5 to your computer and use it in GitHub Desktop.
my version of PinBar function
double PinBar2(int minimumBar) {
double o=Open[1], c=Close[1];
double h=High[1], l=Low[1];
double b = MathAbs( o - c );
if ((h-l) < minimumBar*pips2dbl) //ignoruj śmieci
return(0.0);
double wup = h - MathMax(o, c), wdn = MathMin(o, c) - l;
if (wup >= 2.0*b && wdn <= b) //długi górny wąs - sygnał na krótką
return (-wup/b);
if (wdn >= 2.0*b && wup <= b) //długi dolny wąs - sygnał na długą
return (wdn/b);
return (0.0);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment