sheriffonline: i want to confirm whether the formula is correct or not?
- Don't write hard to read code like that. That is why you are unsure. Make your code self documenting:
double bodyBottom = MathMin(Open[1], Close[1]); double bodyTop = MathMax(Open[1], Close[1]); double body = bodyTop - bodyBottom; double lowerWick = bodyBottom - Low[1]; double upperWick = High[1] - bodyTop; bool isHammer = lowerWick > 2*body && upperWick < lowerWick*0.10; bool isWhiteHammer = Close[1] > Open[1] && isHammer; bool isBlackHammer = Close[1] < Open[1] && isHammer;
Do you have any confusion with any of those lines? Does the formula match? - Second if - black hammer.
WHRoeder:
- Don't write hard to read code like that. That is why you are unsure. Make your code self documenting:Do you have any confusion with any of those lines? Does the formula match?
- Second if - black hammer.
Yes. formula matches with mine. but yours are simple.
is this correct formula for hammer?
sheriffonline:
Yes. formula matches with mine. but yours are simple.
is this correct formula for hammer?
WHRoeder:
- Don't write hard to read code like that. That is why you are unsure. Make your code self documenting:Do you have any confusion with any of those lines? Does the formula match?
- Second if - black hammer.
Hi,
I never experienced with bool operations. can you support me how to use if conditions for these bool operations. i tried following code, but fails.
{ if (isWhiteHammer==true) { } }
sheriffonline: I never experienced with bool operations. can you support me how to use if conditions for these bool operations. i tried following code, but fails.
if (isWhiteHammer==true)
- "fails" is meaningless - just like saying the car doesn't work. Doesn't start, won't go in gear, no electrical, missing the key, flat tires - meaningless. There are no mind readers here.
- Nothing wrong with that.
- You would never write if( (2+2 == 4) == true) would you? if(2+2 == 4) is sufficient. So Don't write if(bool == true), just use if(bool) or if(!bool).
WHRoeder:
Thank you so much WHRoeder. Works fine here. Thank you for illustrated me like teaching kids. Ofcourse i am Kids in MQL4.. LOL...
- "fails" is meaningless - just like saying the car doesn't work. Doesn't start, won't go in gear, no electrical, missing the key, flat tires - meaningless. There are no mind readers here.
- Nothing wrong with that.
- You would never write if( (2+2 == 4) == true) would you? if(2+2 == 4) is sufficient. So Don't write if(bool == true), just use if(bool) or if(!bool).
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
Hi,
I am currently adding candlestick pattern for my EA.
herewith i found formula for black hammer/white hammer from our forum. but i want to confirm whether the formula is correct or not?
if its wrong please help me what exact formula to find hammer candlestick?
Thanks in Advance.