Indicators with alerts/signal - page 33

 

Sound Alert on AMA

Bonjour,

could someone please put a sound alert on this Ama.

Thanks a lot.

Ps: This is the only AMA i know not available in XpMa of coders' Guru.

 

Fractals, Barry Sup-Res

I see this question has been asked twice but no one has added an alert to it. Can you add an alert to the basic fractals indicator when ever a NEW fractal appears. If anyone has the Support & Resistance (Barry) file add it to that. Either one would work.

 

CCI Alert

Hi,

I am trying to find an alert for the cci for when it crosses the 0 line. Does anyone have this? Preferably the alert would remain on till cancelled. Or be able to insert a .wav file for when it crosses. Thanks for your help.

George

 

alert me when theres a buy signal

Can someone tell me how to add an alert to this expert please. I'm sure its simple, but I cant seem to find it. I'm just starting out and this would be of great help.

Thank you

Leo1452

extern int MagicNumber = 0;

extern bool SignalMail = False;

extern bool EachTickMode = False;

extern double Lots = 1.0;

extern int Slippage = 3;

extern bool StopLossMode = True;

extern int StopLoss = 30;

extern bool TakeProfitMode = True;

extern int TakeProfit = 60;

extern bool TrailingStopMode = True;

extern int TrailingStop = 30;

#define SIGNAL_NONE 0

#define SIGNAL_BUY 1

#define SIGNAL_SELL 2

#define SIGNAL_CLOSEBUY 3

#define SIGNAL_CLOSESELL 4

int BarCount;

int Current;

bool TickCheck = False;

//+------------------------------------------------------------------+

//| expert initialization function |

//+------------------------------------------------------------------+

int init() {

BarCount = Bars;

if (EachTickMode) Current = 0; else Current = 1;

return(0);

}

//+------------------------------------------------------------------+

//| expert deinitialization function |

//+------------------------------------------------------------------+

int deinit() {

return(0);

}

//+------------------------------------------------------------------+

//| expert start function |

//+------------------------------------------------------------------+

int start() {

int Order = SIGNAL_NONE;

int Total, Ticket;

double StopLossLevel, TakeProfitLevel;

if (EachTickMode && Bars != BarCount) TickCheck = False;

Total = OrdersTotal();

Order = SIGNAL_NONE;

//+------------------------------------------------------------------+

//| Variable Begin |

//+------------------------------------------------------------------+

double Buy1_1 = iMA(NULL, 0, 89, 0, MODE_SMA, PRICE_CLOSE, Current + 0);

double Buy1_2 = iClose(NULL, 0, Current + 0);

double Buy2_1 = iMA(NULL, 0, 445, 0, MODE_EMA, PRICE_CLOSE, Current + 0);

double Buy2_2 = iClose(NULL, 0, Current + 0);

//+------------------------------------------------------------------+

//| Variable End |

//+------------------------------------------------------------------+

//Check position

bool IsTrade = False;

for (int i = 0; i < Total; i ++) {

OrderSelect(i, SELECT_BY_POS, MODE_TRADES);

if(OrderType() <= OP_SELL && OrderSymbol() == Symbol()) {

IsTrade = True;

if(OrderType() == OP_BUY) {

//Close

//+------------------------------------------------------------------+

//| Signal Begin(Exit Buy) |

//+------------------------------------------------------------------+

//+------------------------------------------------------------------+

//| Signal End(Exit Buy) |

//+------------------------------------------------------------------+

if (Order == SIGNAL_CLOSEBUY && ((EachTickMode && !TickCheck) || (!EachTickMode && (Bars != BarCount)))) {

OrderClose(OrderTicket(), OrderLots(), Bid, Slippage, MediumSeaGreen);

if (SignalMail) SendMail("[Signal Alert]", "[" + Symbol() + "] " + DoubleToStr(Bid, Digits) + " Close Buy");

if (!EachTickMode) BarCount = Bars;

IsTrade = False;

continue;

}

//Trailing stop

if(TrailingStopMode && TrailingStop > 0) {

if(Bid - OrderOpenPrice() > Point * TrailingStop) {

if(OrderStopLoss() < Bid - Point * TrailingStop) {

OrderModify(OrderTicket(), OrderOpenPrice(), Bid - Point * TrailingStop, OrderTakeProfit(), 0, MediumSeaGreen);

if (!EachTickMode) BarCount = Bars;

continue;

}

}

}

} else {

//Close

//+------------------------------------------------------------------+

//| Signal Begin(Exit Sell) |

//+------------------------------------------------------------------+

//+------------------------------------------------------------------+

//| Signal End(Exit Sell) |

//+------------------------------------------------------------------+

if (Order == SIGNAL_CLOSESELL && ((EachTickMode && !TickCheck) || (!EachTickMode && (Bars != BarCount)))) {

OrderClose(OrderTicket(), OrderLots(), Ask, Slippage, DarkOrange);

if (SignalMail) SendMail("[Signal Alert]", "[" + Symbol() + "] " + DoubleToStr(Ask, Digits) + " Close Sell");

if (!EachTickMode) BarCount = Bars;

IsTrade = False;

continue;

}

//Trailing stop

if(TrailingStopMode && TrailingStop > 0) {

if((OrderOpenPrice() - Ask) > (Point * TrailingStop)) {

if((OrderStopLoss() > (Ask + Point * TrailingStop)) || (OrderStopLoss() == 0)) {

OrderModify(OrderTicket(), OrderOpenPrice(), Ask + Point * TrailingStop, OrderTakeProfit(), 0, DarkOrange);

if (!EachTickMode) BarCount = Bars;

continue;

}

}

}

}

}

}

//+------------------------------------------------------------------+

//| Signal Begin(Entry) |

//+------------------------------------------------------------------+

if (Buy1_1 < Buy1_2 && Buy2_1 < Buy2_2) Order = SIGNAL_BUY;

//+------------------------------------------------------------------+

//| Signal End |

//+------------------------------------------------------------------+

//Buy

if (Order == SIGNAL_BUY && ((EachTickMode && !TickCheck) || (!EachTickMode && (Bars != BarCount)))) {

if(!IsTrade) {

//Check free margin

if (AccountFreeMargin() < (1000 * Lots)) {

Print("We have no money. Free Margin = ", AccountFreeMargin());

return(0);

}

if (StopLossMode) StopLossLevel = Ask - StopLoss * Point; else StopLossLevel = 0.0;

if (TakeProfitMode) TakeProfitLevel = Ask + TakeProfit * Point; else TakeProfitLevel = 0.0;

Ticket = OrderSend(Symbol(), OP_BUY, Lots, Ask, Slippage, StopLossLevel, TakeProfitLevel, "Buy(#" + MagicNumber + ")", MagicNumber, 0, DodgerBlue);

if(Ticket > 0) {

if (OrderSelect(Ticket, SELECT_BY_TICKET, MODE_TRADES)) {

Print("BUY order opened : ", OrderOpenPrice());

if (SignalMail) SendMail("[Signal Alert]", "[" + Symbol() + "] " + DoubleToStr(Ask, Digits) + " Open Buy");

} else {

Print("Error opening BUY order : ", GetLastError());

}

}

if (EachTickMode) TickCheck = True;

if (!EachTickMode) BarCount = Bars;

return(0);

}

}

//Sell

if (Order == SIGNAL_SELL && ((EachTickMode && !TickCheck) || (!EachTickMode && (Bars != BarCount)))) {

if(!IsTrade) {

//Check free margin

if (AccountFreeMargin() < (1000 * Lots)) {

Print("We have no money. Free Margin = ", AccountFreeMargin());

return(0);

}

if (StopLossMode) StopLossLevel = Bid + StopLoss * Point; else StopLossLevel = 0.0;

if (TakeProfitMode) TakeProfitLevel = Bid - TakeProfit * Point; else TakeProfitLevel = 0.0;

Ticket = OrderSend(Symbol(), OP_SELL, Lots, Bid, Slippage, StopLossLevel, TakeProfitLevel, "Sell(#" + MagicNumber + ")", MagicNumber, 0, DeepPink);

if(Ticket > 0) {

if (OrderSelect(Ticket, SELECT_BY_TICKET, MODE_TRADES)) {

Print("SELL order opened : ", OrderOpenPrice());

if (SignalMail) SendMail("[Signal Alert]", "[" + Symbol() + "] " + DoubleToStr(Bid, Digits) + " Open Sell");

} else {

Print("Error opening SELL order : ", GetLastError());

}

}

if (EachTickMode) TickCheck = True;

if (!EachTickMode) BarCount = Bars;

return(0);

}

}

if (!EachTickMode) BarCount = Bars;

return(0);

}

//+------------------------------------------------------------------+

 

Testing the close of the bar

How do I test for the closing price of a bar?

close_val = iClose(Symbol(),TimeFrame,i);

if (close_val > 0) ....

Draw a dot

Am I right in thinking that if close_val > 0 then the bar has completed, a zero value means that the bar is still forming. Is this correct? I would like to draw a dot underneath or above the bar only when the bar has completed.

 
Sadly:
How do I test for the closing price of a bar?

close_val = iClose(Symbol(),TimeFrame,i);

if (close_val > 0) ....

Draw a dot

Am I right in thinking that if close_val > 0 then the bar has completed, a zero value means that the bar is still forming. Is this correct? I would like to draw a dot underneath or above the bar only when the bar has completed.

iClose is the price. Close price of the bar. Sometimes the close price of the bar is comparing with some indicator's value (indicators which are attached on the main window to ghave the same scale with the price).

double iClose( string symbol, int timeframe, int shift)[/CODE]

For example:

iClose(NULL,5,pr)[/CODE]

where NULL is current simbol (simbol of the chart);

5 is timeframe

pr is the bar.

If pr=1 so iClose(NULL,5,1) is the close price of the previous bar on M5 timeframe. This value of the close bar we are using in most of the EAs.

Which pair? any pair attached to.

You may use numbers, for example:

[CODE]iClose(NULL,5,1)

Or you may do it selectable (and multi timeframe indicator):

[CODE]iClose(NULL,close_timeframe,pr)

and in the beginning of your indicator wrote:

extern int pr=1;

extern int close_timeframe=5;

and as a results you may change number of bar and timeframe in the settings.

For example you may attach indicator to the M5 chart with close_timeframe=60 and you will get the price for close H1 bar on M5 chart.

So, the next may be the following:

close price may be dotted on the chart, or arrows, or comments/text on the chart, or placed in separated text file, alarm, alert, email, sms and so on.

This price may be compare with some other price, with some other systems and so on. For example:

"Present close price for H1 chart is 1.9670:

- BrainTrading system H1/M15: uptrend - it was buy at 5 am at the price 1.9650;

- Dolly: uptrend - buy at ......

- Zigzag Trading system: flat

- Ichimoku: flat, possible reversal at the price 1.9690 at 6 pm today, next reversal at 2 am tomorrow at the price ...

- 6sma system: flat, possible sell for tomorrow ...

- Nina system: ..."

and so on.

There is indicator in this thread. Name of this indicator is Commentator.

So I have an idea. There are a lot of trading systems on our forum. And we do not have time to follow all of them every day. So it may be good to have indicator which giving alert/alarm/email/text-on-the-chart/placing-on-the-text-file about direction of the trend and the trading signals ...

I am not sure about how my expalantion understandable or not but I think it is not difficult to do. Just a free time.

 

Thank you so much NewDigital. I honestly try to work these things out by myself as best I can without wanting to put anyone to any bother but when I hit a brick wall and start thumping my head against the table I really have no other option but to ask here. I really appreciate the time you spend answering questions and giving solutions. Thank you.

 

3 color macd alert

Can someone please help me! I have a 3 color macd that I need an alert set on it when it crosses the zero line and when the bars have 2 consecutive color changes. Is this possible? Can you specify a beginning and end time for the alert period? (ie. 2:00 am EST thru 12 noon EST)

 

MA_Crossover_Alert3-34.mq4

First thanks for all your post in this site. This help us a lot.

I try a lot of indicator and AE, and at the moment the best for me is this, because never fail. Go steep by steep, but is without risk. Only the big problem is that all the day you must do atent to the signals from your computer and dont lose any position.

I think that if some body can translate this indicator in one AE, this will be more easy the trading.

Can some body translate this indicator in one AE in automated trader?

Only need send the signal when the signal in the map apear. No when do the alarm, only when apear the signal on the map.

Very thanks a lot for all your apreciate help

Best Regards

Carlos

 

Statistician needed! Stop Loss & Risk facts.

I am trading 7 currency pairs using H1 charts and would like to place stop losses at the optimum place for each pair on the basis that it will be 75% correct in stopping me out before a reversal?

Also, does anyone know the risk for each currency pair? It is clear that a $ invested in gbp/jpy carries far more risk for rewards or losses than gbp/usd, but can anyone work out what it is?

Reason: