Dont understand why I cant here PlaySound() New comment Stephen Reynolds 2016.03.09 20:50 In the following Indicator I fail to see why I cant here the PlaySound sounfile ive assigned to the SoundFile object?Also it appears to overun my CPU?// Turning Pivot Alarms On/Off Input Variables input string SoundFile = "alert.wav"; //+------------------------------------------------------------------+ //| Custom indicator iteration function | //+------------------------------------------------------------------+ int OnCalculate(const int rates_total, // size of input time series (here it starts 1001 on 00:00 and continues) const int prev_calculated, // bars handled in previous call (here it returns 0 on 00:00 and 1001 on 00:30 and continues) const datetime &time[], const double &open[], const double &high[], const double &low[], const double &close[], const long &tick_volume[], const long &volume[], const int &spread[]) { int bars = rates_total - 1; if(prev_calculated > 0) bars = rates_total - prev_calculated; for(int i = bars; i >= 1; i--) { if(Close[i] > Open[i]) { PlaySound(SoundFile); } if(Close[i] < Open[i]) { PlaySound(SoundFile); } //--- return value of rates_total for next call return(rates_total); } Cant understand ObectCreate() function sub window parameter? Why cant I read another symbol off chart? Operational confusion? [Deleted] 2016.03.09 22:02 #1 Delete for(int i = bars; i >= 1; i--) { Stephen Reynolds 2016.03.10 10:22 #2 eevviill: Delete { Thanks for that it works. New comment
In the following Indicator I fail to see why I cant here the PlaySound sounfile ive assigned to the SoundFile object?
Also it appears to overun my CPU?