Help with HAMMER code please
svezir:
Hello,
Can you show a screen/chart grab showing an example of what yo mean by some candlesticks getting wrongly identified . . . . I know what you mean but I don't see how it can be from your code so an example might help.
Hello,
I am starting newly in mql4. Trying to pick black and white hammers in candlesticks with the following indicator. However, in the chart sometimes candlesticks get wrong identification text (white hammer candle is identified as black hammer candle and vice versa). Please help me with this situation, thanks in advance.
I think your problem is your Object names . . . your most recent Object has a name of "2" when a few more bars pass and you get a new hammer what will it's object name be ?
RaptorUK:
I think your problem is your Object names . . . your most recent Object has a name of "2" when a few more bars pass and you get a new hammer what will it's object name be ?
I think your problem is your Object names . . . your most recent Object has a name of "2" when a few more bars pass and you get a new hammer what will it's object name be ?
Exactly.
for(N = 1; N < limit; N++) { hammer[N]= CharToStr(N); N1 = N + 1; N2 = N + 2;
CharToStr takes a character, 0-127, your passing invalid values.- You don't need to save the names
- You could just use
string name = "hmnr" + TimeToStr(TimeCurrent(), TIME_MINUTES); ObjectCreate(name..);
- Your creating an indicator, you shouldn't be creating objects at all, Look at the fractal indicator.


I am starting newly in mql4. Trying to pick black and white hammers in candlesticks with the following indicator. However, in the chart sometimes candlesticks get wrong identification text (white hammer candle is identified as black hammer candle and vice versa). Please help me with this situation, thanks in advance.