Alerte Sonore

Forum pour débuter en Bourse : actions, futures, CFD à risque limité, ordres, vocabulaire des marchés. Posez vos premières questions, la communauté Andlil répond depuis 2011.
budfoxob
Messages : 2
Enregistré le : 03 janv. 2014 11:12

Alerte Sonore

Message non lu par budfoxob »

Bonjour à tous,

Tout nouveau sur le forum, je vous sollicite car n'y connaissant strictement rien en programmation, je souhaiterai ajouter une alerte sonore sur mon indicateur Osma, lorsque l'histogramme passe du négatif au positif et réciproquement, ou coupe 0 par le haut ou par le bas.
Est ce qu'une âme charitable aurait la possibilité de m'ajouter ce bout de code à mon indicateur?

Voici le code de l'Osma :
//+------------------------------------------------------------------+
//| OsMA.mq4 |
//| |
//| |
//+------------------------------------------------------------------+
#property copyright "Copyright © 2004, MetaQuotes Software Corp."
#property link "http://www.metaquotes.net/"
//---- indicator settings
#property indicator_separate_window
#property indicator_buffers 1
#property indicator_color1 Silver
#property indicator_width1 2
//---- indicator parameters
extern int FastEMA=12;
extern int SlowEMA=26;
extern int SignalSMA=9;
//---- indicator buffers
double OsmaBuffer[];
double MacdBuffer[];
double SignalBuffer[];

//+------------------------------------------------------------------+
//| Custom indicator initialization function |
//+------------------------------------------------------------------+
int init()
{
//---- 2 additional buffers are used for counting.
IndicatorBuffers(3);
//---- drawing settings
SetIndexStyle(0,DRAW_HISTOGRAM);
SetIndexDrawBegin(0,SignalSMA);
IndicatorDigits(Digits+2);
//---- 3 indicator buffers mapping
SetIndexBuffer(0,OsmaBuffer);
SetIndexBuffer(1,MacdBuffer);
SetIndexBuffer(2,SignalBuffer);
//---- name for DataWindow and indicator subwindow label
IndicatorShortName("OsMA("+FastEMA+","+SlowEMA+","+SignalSMA+")");
//---- initialization done
return(0);
}
//+------------------------------------------------------------------+
//| Moving Average of Oscillator |
//+------------------------------------------------------------------+
int start()
{
int limit;
int counted_bars=IndicatorCounted();
//---- last counted bar will be recounted
if(counted_bars>0) counted_bars--;
limit=Bars-counted_bars;
//---- macd counted in the 1-st additional buffer
for(int i=0; i<limit; i++)
MacdBuffer=iMA(NULL,0,FastEMA,0,MODE_EMA,PRICE_CLOSE,i)-iMA(NULL,0,SlowEMA,0,MODE_EMA,PRICE_CLOSE,i);
//---- signal line counted in the 2-nd additional buffer
for(i=0; i<limit; i++)
SignalBuffer=iMAOnAr (MacdBuffer,Bars,SignalSMA,0,MODE_SMA,i);
//---- main loop
for(i=0; i<limit; i++)
OsmaBuffer=MacdBuffer-SignalBuffer;
//---- done
return(0);
}
//+------------------------------------------------------------------+


Merci beaucoup pour votre aide.
Avatar du membre
DeXTeR
Stormtrooper
Messages : 169
Enregistré le : 15 déc. 2013 04:05

Re: Alerte Sonore

Message non lu par DeXTeR »

oula...toi tu te présente pas, et 1er message tu demande de l'aide...à mon avis les modos vont bientot arriver :p
budfoxob
Messages : 2
Enregistré le : 03 janv. 2014 11:12

Re: Alerte Sonore

Message non lu par budfoxob »

Super merci