読み取り専用

フォーラムは現在、読み取り専用のアーカイブとなっています。.

バグ報告やプラットフォームに関する質問はこちら → [email protected]

私たちのコミュニティはDiscordとYouTubeで活動しています。ぜひ参加してください!

ご参加ください Discord YouTube

Play a custom audio file in Signal Indicator

5件の返信

TJ#

Customer, bbp_participant, community, 143件の返信。.

プロフィールを表示

12年前 #112772

hi Admin,

 

Under the signal indicator. How can I play a custom audio file?

 

Such as, PlaySound(“Starwars.wav”) while the default is PlaySound(“alert.wav”). 

 

よろしくお願いいたします。,

 

TJ

0

マーク・フリック

管理者、sq-ultimate、2件の返信.

プロフィールを表示

11年前 #127291

こんにちは,

 

unfortunately signal indicators in EA Wizard only draw signals on chart, they don’t perform  custom actions that you specified in THEN section.

But you can combine it with an EA – have the same signal indicator exported as an EA that will play sound and then as signal indicator that will display the dots.

 

Yes,you should use file name of audio file in PlaySound function.According to MT4 help sound file should be located in terminal_directory\Sounds

マーク
StrategyQuantアーキテクト

0

TJ#

Customer, bbp_participant, community, 143件の返信。.

プロフィールを表示

11年前 #127314

hi Mark,

 

I tried the Starwars.wav as a price alert, it works perfectly but when I try to used it in EA Wizard (signal indicator) it will not play the Starwars.wav but played the default tone (alert.wav). Is there a bug somewhere in my version? 

 

Audio file is stored under, 

C:\Program Files (x86)\OANDA MT4\Sounds

 

よろしくお願いいたします。,

 

TJ

0

マーク・フリック

管理者、sq-ultimate、2件の返信.

プロフィールを表示

11年前 #127371

this is because in signal indicator mode it doesn’t use THEN actions at all, it uses Alert() function of MT4 and this is accompanied by the default sound.

 

You’d have to edit the signal indicator code – find where Alert() is used and put there your sound playing function.

マーク
StrategyQuantアーキテクト

0

TJ#

Customer, bbp_participant, community, 143件の返信。.

プロフィールを表示

11年前 #127657

親愛なるマークさん、,
 

I am not a programmer hence not sure what and where to look for the alert but I have trigger the search function and highlighted all the word “alert” and below are the sections that has the word “alert”, so which liner should I change to play the “starwars.wav” file? 

 

Thank you very much. 🙂 

“
…
…
 
extern bool    MT4警告 = true;
extern bool    Email警告 = true;
extern string  EmailSubject = “Signal 警告 : “;
extern int     LookBackForAlerts = 5;
…
…
 
void processSignal(int signalIndex, int i) {
   if(getSignal(signalIndex, i)) {
      drawSignal(signalIndex, i, getDrawOffset(signalIndex, i));
 
      bool previousSignal = getSignal(signalIndex, i+1);
      if(previousSignal == false && i<=LookBackForAlerts && (lastSignalDisplayed == 0 || lastSignalDisplayed < Time[i])) {
         // send alerts
         lastSignalDisplayed = Time[i];
 
         string alertText = getAlertText(signalIndex, i);
 
         if(MT4警告) {
            警告(alertText);
         }
         if(Email警告) {
            SendMail(StringConcatenate(EmailSubject, “Ind_M1_V4”), alertText);
         }
      }
   } else {
      drawSignal(signalIndex, i, 0);
   }
}
 
//+——————————————————————+
 
string get警告Text(int signalIndex, int i) {
   string text = Symbol() +”/” + getPeriodAsString() + ” – ” + TimeToStr(Time[i]);
   text = StringConcatenate(text, ” Signal 警告 :”);
 
if(signalIndex == 1) {
      text = StringConcatenate(text, ” Long (#1, Unknown) : “);
      text = StringConcatenate(text, Signal1Text);
   }
if(signalIndex == 2) {
      text = StringConcatenate(text, ” Short (#2, Unknown) : “);
      text = StringConcatenate(text, Signal2Text);
   }
 
   return(text);

…
…
 

“

0

マーク・フリック

管理者、sq-ultimate、2件の返信.

プロフィールを表示

11年前 #127908

ok, you can edit the code and add the code to play sound into this block:

 

if(MT4警告) {
   警告(alertText);
   
PlaySound(“Starwars.wav”); // added

}

 

 

I’m not sure if it would work, because I’m not sure if MT4 allows indicators to play sounds, but probably yes.

マーク
StrategyQuantアーキテクト

0

5件の返信を表示中 - 1 - 5件目 (全5件中)