another indicator....another alert needed...thanks

 

have been trying to add an audible/email alert to this hma modified indicator.its actually the mod made by fxigor(signal line indicator) for his system and i have just made it into a bar indicator,so if anyone could add an alert on to it that would be great..........and if your really bored and feel up to it i think this indicator would be great drawn on the main chart as bars/candles kinda like a heinken ashi idea........have tried that too and failed....well not completley i managed to get the bear candles drawn so got half way there and from that "half veiw" on the chart it looked like a nice indi.

thanks for any help on this..............thestellaman

Files:
 

hey stellaman..... i took out the parameters, min and max, for indicator properties window which of course then creates the standard histogram plot....

momemtum can be sometimes seen when we look at a histogram, that's it's purpose, but can not be seen on a horizontal bar.... either way it's a neat indicator....

we should be able to add any type alert along with the hienkin ashi idea, or painted bars.....

will tackle both jobs today, unless an unseen fumble occurs.....h

 

hey hayseed , nice you coming to my rescue again,i am learning though and some day i "might " be able to finish something iv'e started but until then if your ever in the neighbourhood then the next beers on me..........thanks again m8,look forward to what you end up with...........................thestellaman

 

hey stellaman.... i'm having a heck of a time determining how to best view that indicator.... if we focus on nothing but the color changes it seems to give way to many false signals, ones that will surely be loosers....

it almost looks like focusing on the 0 line crossover would work best.... below is the first step in that direction..... you'll need the 'trend bars' indicator in your list cause this indicator will be referencing to it via 'icustom'.....

the email part can become a real pain if many signals are triggering.... still studyin on it........ h

Files:
 

hi hayseed.............not getting anythin but blue bars when i put the "painted trend bars" indicator on the chart, have made sure trend bars is there to and even added to same chart and still no joy,compiled it a couple of times and restart but just blue on the chart..........any ideas?

as for you saying about the best way to veiw the indicator........at the mo i am using it purely on the close of the bar if the trend changes then(taking other indis into account)

see pict for how i use it in trade(nice little 101 pips)............i have coloured the red bars on the chart myself hayseed incase you think i got the indicator working.

you can see now with other indicators added that it could be a nice indicator.

when you said about too many "false signals" did you mean trading EVERY colour change or did you mean when a bar is close to the 0 cross over that it generates a signal on every tick until the bar is finaly closed?

thanks for your time...............thestellaman

Files:
pict_1.jpg  98 kb
 

hey stellaman.... make sure you have the original indicator in your list and the name must be Trend Bars ..... exactly ...... Trend Bars ..... the painted indicator will attempt to call it..... did it compile ok or was there a warning error.....

i set it to change colors at the 0 line crossover..... you can adjust the period length and also method, sma, ema and such....

i created an ea from the original indicator and it had a large number of false trades, loosing..... the 0 line crossover fared better.....h

Files:
trend_bars.gif  67 kb
 

hi hayseed...............still having probs, i do have "Trend Bars" in the list and have taken out the min max parameters also and recomplied it but still no joy. the "painted trend bars" is also complining ok also, i notice on the pict you posted that your Trend Bars indicator has a 0 line cross mine does not ,did you change any thing else in the script ?

#property indicator_separate_window 

#property indicator_buffers 2
#property indicator_color1 DarkGoldenrod
#property indicator_color2 LightGreen

//---- input parameters
extern int period=15;
extern int method=3; // MODE_SMA
extern int price=0; // PRICE_CLOSE
//---- buffers
double Uptrend[];
double Dntrend[];
double ExtMapBuffer[];

//+------------------------------------------------------------------+
//| Custom indicator initialization function |
//+------------------------------------------------------------------+
int init()
{
IndicatorBuffers(3);
SetIndexBuffer(0, Uptrend);
//ArraySetAsSeries(Uptrend, true);
SetIndexBuffer(1, Dntrend);
//ArraySetAsSeries(Dntrend, true);
SetIndexBuffer(2, ExtMapBuffer);
ArraySetAsSeries(ExtMapBuffer, true);

SetIndexStyle(0,DRAW_HISTOGRAM,STYLE_SOLID,2);
SetIndexStyle(1,DRAW_HISTOGRAM,STYLE_SOLID,2);

IndicatorShortName("Trend Bars("+period+")");
return(0);
}
//+------------------------------------------------------------------+
//| Custor indicator deinitialization function |
//+------------------------------------------------------------------+
int deinit()
{
// ???? ????? ?????? ??????
return(0);
}
//+------------------------------------------------------------------+
//| ?????????? ??????? |
//+------------------------------------------------------------------+
double WMA(int x, int p)
{
return(iMA(NULL, 0, p, 0, method, price, x));
}
//+------------------------------------------------------------------+
//| Custom indicator iteration function |
//+------------------------------------------------------------------+
int start()
{
int counted_bars = IndicatorCounted();

if(counted_bars < 0)
return(-1);

int x = 0;
int p = MathSqrt(period);
int e = Bars - counted_bars + period + 1;

double vect[], trend[];

if(e > Bars)
e = Bars;
ArrayResize(vect, e);
ArraySetAsSeries(vect, true);
ArrayResize(trend, e);
ArraySetAsSeries(trend, true);

for(x = 0; x < e; x++)
{
vect[x] = 2*WMA(x, period/2) - WMA(x, period);
// Print("Bar date/time: ", TimeToStr(Time[x]), " close: ", Close[x], " vect[", x, "] = ", vect[x], " 2*WMA(p/2) = ", 2*WMA(x, period/2), " WMA(p) = ", WMA(x, period));
}
for(x = 0; x < e-period; x++)

ExtMapBuffer[x] = iMAOnArray(vect, 0, p, 0, method, x);

for(x = e-period; x >= 0; x--)
{
trend[x] = trend[x+1];
if (ExtMapBuffer[x]> ExtMapBuffer[x+1]) trend[x] =1;
if (ExtMapBuffer[x]< ExtMapBuffer[x+1]) trend[x] =-1;

if (trend[x]>0)
{ Uptrend[x] = ExtMapBuffer[x];
if (trend[x+1]<0) Uptrend[x+1]=ExtMapBuffer[x+1];
Dntrend[x] = EMPTY_VALUE;
}
else
if (trend[x]<0)
{
Dntrend[x] = ExtMapBuffer[x];
if (trend[x+1]>0) Dntrend[x+1]=ExtMapBuffer[x+1];
Uptrend[x] = EMPTY_VALUE;
}

//Print( " trend=",trend[x]);
}

return(0);
}
//+------------------------------------------------------------------+

that is my Trend Bars

Files:
trend_bars.jpg  91 kb
 

hey stellaman.... are you by chance using windows vista..... from the picture it looks like you are..... if so, vista reacts differently than xp when it comes to metatrader.....

your indicator is definitely plotting different than mine.... so there must be some small difference in coding thats removing the 0 reference..... the lack of 0 reference is why the painted bars are blue..... below here are both indicators but with different names.... see if after downloading/compiling both if they work.....

i changed the names to aleviate any possible vista problems, 'stella' refers to the trend bars and 'stellaman' refers to the painted trend bars......h

Files:
stellaman.mq4  5 kb
stella.mq4  4 kb
 

forgot to mention..... the indicator you posted in code is plots perfect here , just like mine.....

try this...... make sure all metaeditors are closed, and with your demo 1630749 open, and no others, click on the navigator button so you can see your 'Trend Bars' indicator in the list..... right click on it and select modify..... that should open the correct metaeditor and open that exact 'Trend Bars' indicator.....

look very close and see if is exactly like the one you posted in the code above.....

also make sure if it says Trend Bars[1] to remove the [1] , must be only Trend Bars..... h

 

hi hayseed...............arghhhhhhhhhhhh

ok tried them on a xp pc and still the same probs,they are compling ok,so no errors there,checked the script and they match,dont have a [1].

so im lost here,thanks for your patience and help,will keep on trying and let you know how i get on.............thestellaman

Files:
arghhhhhhhh.jpg  129 kb
 

hey stellaman..... hmmmmm... interesting..... it could possibly be that we are using differing metatrader builds..... i have the update feature turned off, so my builds are 205 or prior...... what version are you using.....

i'll download a new demo copy of the latest version and cross check.... clearly something is amiss....... vista is very tricky , almost a pain, when it comes to metatrader..... kinda thought that was the deal..... we'll figure it out.....h

Reason: