Jump to content

Welcome to the new Traders Laboratory! Please bear with us as we finish the migration over the next few days. If you find any issues, want to leave feedback, get in touch with us, or offer suggestions please post to the Support forum here.

  • Welcome Guests

    Welcome. You are currently viewing the forum as a guest which does not give you access to all the great features at Traders Laboratory such as interacting with members, access to all forums, downloading attachments, and eligibility to win free giveaways. Registration is fast, simple and absolutely free. Create a FREE Traders Laboratory account here.

Tams

Adding Sound to Your Indicator (EasyLanguage)

Recommended Posts

This thread is about Adding Sound to your Indicator (EasyLanguage)

 

 

 

syntax:

 

PlaySound

 

Plays the specified wave (.wav) sound file.

 

Usage

 

PlaySound("PathFilename")

 

Where: PathFilename - a string expression specifying the path and filename of the wave file to be played

 

Example

 

Play ding.wav sound file located in the root directory of the C: hard drive:

 

PlaySound("C: \ding.wav");

 

 

 

 

source: EasyLanguage manual

Share this post


Link to post
Share on other sites

I was missing alerts for my strategy exit.

 

If it is intrabar and works in signal , that's very interesting :)

 

Because alert plays at the end of the bar... sometimes that's too late.

 

And repeat is quite boring.

Share this post


Link to post
Share on other sites

Right now the alert says "support 1 mn" every seconds during 1 mn...:crap:

 

Stressing, specially now with a terribly bullish market (2.60 % and NY opens in 1 hour)

 

This alert should be better if it starts only once in intrabar

 

I will test your solution

Share this post


Link to post
Share on other sites

Please TAMS , Next topic = regression channel :)

 

The chart shows the end run of a huge wave

 

Question =

 

Could it be possible to cross the higher trendline ?

 

The regression channel has the answer ?

 

Market is like a donkey trying to reach the carot line :roll eyes:

Untitled-1.thumb.jpg.27218675c9f731c258bdc875cc16fa49.jpg

Share this post


Link to post
Share on other sites
Please TAMS , Next topic = regression channel :)

...

 

 

I think there are already a few threads on that.

but you can always start a new thread.

 

;-)

Share this post


Link to post
Share on other sites

I've done that

 

// Alert

if Value1 > Value1[1] 		then
             PlaySound("D:\MyPath\Audio\support 1 mn.wav"); 
//		Alert( " Support" 		);

 

it is like this

 

you can configure the sound criteria in ALERT.

 

pls see attached.

 

Each time the condition is true it plays the sound like this during 1 mn

 

support 1 mn support 1 mn support 1 mn support 1 mn support 1 mn support 1 mn support 1 mn support 1 mn support 1 mn support 1 mn support 1 mn support 1 mn support 1 mn support 1 mn support 1 mn support 1 mn support 1 mn support 1 mn support 1 mn support 1 mn...

 

:crap:

Share this post


Link to post
Share on other sites

The playsound is repeated...

because every time a tick came through, the conditional statement is evaluated.

if the condition is true... then the Playsound statement is executed.

 

to make the sound play once only, you have to add a few things...

 

 

input:
soundon(true);

var:
play.once(0);


if  Value1 > Value1[1]
and [color="Red"]soundon and play.once <> currentbar[/color] then
begin
playsound("C:\soundfiles\support 1 mn.wav");
play.once = currentbar; 
end;

Share this post


Link to post
Share on other sites

It still repeats on each tick instead of only the first one

 

It is a 1 mn chart

 

// Alert

if Value1 > Value1[1] and soundon and play.once <> currentbar 		then
begin
	PlaySound("D:\soundfiles\Support 1 mn.wav");
	play.once = currentbar; 
end;

Share this post


Link to post
Share on other sites
It still repeats on each tick instead of only the first one

It is a 1 mn chart

 

 

ARH... SORRY... I missed one little keyword.

I have highlighted it in red below:

 

 

input:
soundon(true);

var:
[b][color="Red"]intrabarpersist[/color][/b] play.once(0);


if  Value1 > Value1[1]
and soundon and play.once <> currentbar then
begin
playsound("C:\soundfiles\support 1 mn.wav");
play.once = currentbar; 
end;

Share this post


Link to post
Share on other sites

It works fine Tams

 

nice code

 

It is a small walk for a trader and and big one for the community :haha:

 

no really, we have a vocal signal at the same time the indicator plots

 

no x seconds delay or a stressing multiple vocal

 

REAL TIME

Share this post


Link to post
Share on other sites

Before I used

 

myIndicatorUp

myIndicatorDn

 

and set a different message in Tab alert setting

 

Now I use

 

myIndicator

 

with 2 different vocal alerts (Up + Dn or more)

 

I use omnipage vocal engine

 

If you don't have a vocal engine tell me the messages you need and I will create them and post them here

inputs: 
soundon(		1	),
Vocal.Up(		PlaySound("D:\Audio\Support 1 mn.wav")    ),
Vocal.Dn(		PlaySound("D:\Resistance 1 mn.wav") ),

var:
intrabarpersist play.once(		0	);

// Alerts

// Alert Support
if Value1 > Value1[1] and soundon <> 0 and play.once <> currentbar 		    then
begin	
	Vocal.Up ; 
	play.once = currentbar; 
end;

// Alert Resistance

if Value2 < Value2[1] and soundon <> 0 and play.once <> currentbar 		     then
begin
	Vocal.Dn ; 
	play.once = currentbar; 
end;

Share this post


Link to post
Share on other sites

Correction

 

inputs: 
soundon(		1	),
Vocal.Up(		PlaySound("D:\MC.Audio\Your.Vocal.Up.wav")    ),
Vocal.Dn(		PlaySound("D:\MC.Audio\Your.Vocal.Dn.wav") ),

var:
intrabarpersist play.once(		0	);

// Alerts

// Alert Support
if Value1 > Value1[1] and soundon <> 0 and play.once <> currentbar 		    then
begin	
	Vocal.Up ; 
	play.once = currentbar; 
end;

// Alert Resistance

if Value2 < Value2[1] and soundon <> 0 and play.once <> currentbar 		     then
begin
	Vocal.Dn ; 
	play.once = currentbar; 
end;

Share this post


Link to post
Share on other sites

Is The vocal in my signal correct ?

 

Because it plays before, after, without no reasons

 


{---------------- Long Side ----------------}
// Entrie

... (no change)

// Exits

if marketposition = 1 then begin

if  my.conditions and soundon <> 0 and play.once <> currentbar then    	
begin
	Sell ("L1") 1 contracts this Bar ;
	Vocal.Up ; 
	play.once = currentbar; 
end;

Share this post


Link to post
Share on other sites

I think that I know :doh:

 

When my first condition of exit is reached the signal appears on my screen

 

When my second condition of exit is reached the signal appears on my screen

 

(I have 27 exits...)

 

If the condition1 < condition2 and condition1 > stop then

 

each time the price moves around condition1 the vocal sounds

 

If I'm right is there a way to correct that ?

Share this post


Link to post
Share on other sites

with the play.once counter,

the sound will only play ONCE per bar.

 

if you have difference sounds and different conditions,

you can use diffferent counters.

 

e.g.

 

var:

play.once.up(0),

play.once.dn(0),

play.once.buy(0),

play.once.sell(0),

... etc.,

Share this post


Link to post
Share on other sites

OK Tams I'm out of my trade (News 14:30 May601K April639K US unemployment and the future plouf 30 points... how do you say that , "stop hunting" ?)

 

I v'e enter only the first exit

 

if I change play.once with play.once.up

 

I will still have each mn the condition reached

 

is there a way to stop the vocal during the x mn untill the second condition or stop is reached ?

Share this post


Link to post
Share on other sites
OK Tams I'm out of my trade (News 14:30 May601K April639K US unemployment and the future plouf 30 points... how do you say that , "stop hunting" ?)

I v'e enter only the first exit

if I change play.once with play.once.up

I will still have each mn the condition reached

is there a way to stop the vocal during the x mn untill the second condition or stop is reached ?

 

 

I am not sure if I understand what you want.

 

can you list out the operation one action at a time?

Share this post


Link to post
Share on other sites

Oups

 

Sorry Tams

 

It is 22:23 in your huge island and 14:54 in my "tiny" land

 

I was wondering if x > y and delta<= marmelade... so stupid

 

If fact, I don't know why this is vocal chaotic

 

{---------------- Long Side ----------------}
// Entrie

... (no change)

// Exits

if marketposition = 1 then begin

if  my.condition1 and soundon <> 0 and play.once <> currentbar then    	
begin
	Sell ("L1") 1 contracts this Bar ;
	Vocal.Up ; 
	play.once = currentbar; 
end;

if  my.condition2  then 				
	Sell ("L2") 1 contracts this Bar ;

if  my.condition3  then 				
	Sell ("L3") 1 contracts this Bar ;

Share this post


Link to post
Share on other sites
Oups

Sorry Tams

It is 22:23 in your huge island and 14:54 in my "tiny" land

I was wondering if x > y and delta<= marmelade... so stupid

If fact, I don't know why this is vocal chaotic

 

 

 

What do you mean by vocal chaotic?

men's voice changed to boys'?

 

jk...

 

do you mean the sound kept playing non-stop?

 

I have never tried sound in a strategy, I thought it should work the same.

 

have you added the intrabarpersist in front of the variable?

Share this post


Link to post
Share on other sites
What do you mean by vocal chaotic?

men's voice changed to boys'?

 

HaHaHa !

 

Sorry if My english is bad

 

Spricht du Deutsch / Francais / Italian / espanol ?

 

If not, I will still torture you in your langage

 

 

 

I think that I understand/appreciate your code

 

 

When my first condition of exit is reached the signal appears on my screen

 

When my second condition of exit is reached the signal appears on my screen

 

(I have 27 exits...)

 

between the both the vocal sounds oftenly

 

I was wondering that

 

Condition1 reached = signal on screen + vocal

 

After

 

If the condition1 < condition2 and condition1 > stop

 

and condition = OK then

 

each time the price = my condition1 the vocal sounds once in the minute

 

OUF ! my brain is smoking !!!

 

Is ther a way to correct that

 

//-----------------------------------------------------
	inputs:
//----------------------------------------------------

soundon(		1	),
Vocal.Up(		PlaySound("D:\Sell 1 minute.wav")  ),
Vocal.Dn(		PlaySound("D:\Cover 1 minute.wav") );

//----------------------------------------------------------------	  
		variables: 
//----------------------------------------------------------------

intrabarpersist play.once(	0	);

{---------------- Long Side ----------------}
// Entrie

... (no change)

// Exits

if marketposition = 1 then begin

if  my.condition1 and soundon <> 0 and play.once <> currentbar then    	
begin
	Sell ("L1") 1 contracts this Bar ;
	Vocal.Up ; 
	play.once = currentbar; 
end;

if  my.condition2  then 				
	Sell ("L2") 1 contracts this Bar ;

if  my.condition3  then 				
	Sell ("L3") 1 contracts this Bar ;
etc...

Share this post


Link to post
Share on other sites
OUF ! my brain is smoking !!!

Is ther a way to correct that

 

Je suis désolé mais je ne comprends pas.

Je comprends un peu.

Pouvez-vous parler plus lentement ?

 

I took one year of German and one year of French in high school.

That was a long time ago... LOL. Don't try me.

 

 

If you are applying the sound to a 1 min chart, you will get a lot of hits.

you can add one more counter:

 

var:

order.filled(false);

 

if soundon and play.once <> currentbar AND order.filled = false then...

 

 

once the order is filled, the sound will stop.

Share this post


Link to post
Share on other sites

Aouch that's a 100 pts toilet flush !!

 

The vocal plays "Sell S1 1 minute" during all the "7' S" and each beginning of a minute

 

But not always...

 

step by step I'm sure that we will find :cool:

 

I join a pix to explain why I need vocal aids

 

I plot Histogramm colored down to the price wich hides the Signal

 

Big problem...

 

Because I love colored waves

 

1 - 2 - 3 hop !

 

Even tho it's automatic trades I use manual mode to reverse or go out the trade

 

And it's very quick = a few seconds to decide

 

This is why, dear Tams, RealTime Vocals is absolutely "indispensable" (let's try your French ) :(

 

//-----------------------------------------------------
	inputs:
//----------------------------------------------------

soundon(		1	),
Vocal.L1(		PlaySound("D:\Sell L1 1 minute.wav")  ),
Vocal.L2(		PlaySound("D:\Sell L2 1 minute.wav")  ),
Vocal.S1(	PlaySound("D:\Cover S1 1 minute.wav") );
Vocal.S2(	PlaySound("D:\Cover S2 1 minute.wav") );

//----------------------------------------------------------------	  
		variables: 
//----------------------------------------------------------------

intrabarpersist play.once(	0	),
order.filled(		false	);

{---------------- Long Side ----------------}
// Entrie

... (no change)

// Exits

if marketposition = 1 then begin

if  my.condition1 and soundon <> 0 and play.once <> currentbar AND order.filled = false then    	
begin
	Sell ("L1") 1 contracts this Bar ;
	Vocal.S1 ; 
	play.once = currentbar; 
end;

if  my.condition2  then 				
	Sell ("L2") 1 contracts this Bar ;

if  my.condition3  then 				
	Sell ("L3") 1 contracts this Bar ;
etc...

Untitled-1.thumb.jpg.70c42c1a834746f2da150170efed1003.jpg

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Topics

  • Posts

    • HLF Herbalife stock, watch for a bull flag breakout above 9.02 at https://stockconsultant.com/?HLF
    • Date: 1st April 2025.   Will Gold’s Rally Hold Strong as New Trade Tariffs Take Effect Tomorrow?   Gold continues to increase in value for a sixth consecutive day and is trading more than 17% higher in 2025. Amid fear of higher inflation, a recession and the tariffs war escalating investors continue to invest into Gold pushing demand higher. The trade policy from April 2nd onwards continues to be a key factor for the whole market. Can Gold maintain its upward trend? Trade Policy From Tomorrow Onwards Starting as soon as tomorrow, a 25% tariff will be imposed on all passenger cars imported into the United States. While this White House policy is anticipated to negatively affect European industrial performance, it will also lead to higher transportation and maintenance costs for everyday American taxpayers. The negative impact expected on both the EU and US is one of the reasons investors continue to buy Gold. Additionally, last month, President Donald Trump announced reciprocal sanctions against any trade partners that impose import restrictions on US goods. Furthermore, tariffs on products from Canada and the EU could increase even more if they attempt to coordinate a response. Overall, investors continue to worry that new trade barriers will prompt retaliatory measures, particularly from China, the Eurozone, and Japan. Any retaliation is likely to escalate the trade conflict and prompt another reaction from the US. Experts at Goldman Sachs and other investment banks warn that this will lead to rising inflation and unemployment. They also caution that it could effectively halt economic growth in the US.   XAUUSD 1-Hour Chart   The Weakness In The US Dollar Another factor which is allowing the price of XAUUSD to increase in value is the US Dollar which has been unable to maintain any bullish momentum. Despite last week’s Core PCE Price Index rising to its highest level since February 2024, the US Dollar has been unable to see any significant rise in value. Due to the US Dollar and Gold's inverse correlation, the price of Gold is benefiting from the Dollar weakness. Investors worry that new trade barriers will prompt retaliatory measures from China, the Eurozone, and Japan, potentially escalating the conflict. Experts at The Goldman Sachs Group Inc. believe that such actions by the US administration will drive rising inflation and unemployment while effectively halting economic growth in the country. Can Gold Maintain Momentum? When it comes to technical analysis, the price of Gold is not trading at a price where oscillators are indicating the instrument is overbought. The Relative Strength Index currently trades at 68.88, outside of the overbought area, since Gold’s price fell 0.65% during this morning’s session. However, even with this decline, the price still remains 0.40% higher than the day’s open price. In terms of fundamental analysis, there continues to be plenty of factors indicating the price could continue to rise. However, the price movement of the week will also partially depend on the employment data from the US. The US is due to release the JOLTS Job Vacancies for February this afternoon, the ADP Non-Farm Employment Change tomorrow, and the NFP Change and Unemployment Rate on Friday. If all data reads higher than expectations, investors may look to sell to lock in profits at the high price. Key Takeaway Points: Gold’s Rally Continues – Up 17% in 2025 as investors seek safety from inflation, recession fears, and trade tensions. Trade War Impact – New US tariffs and potential retaliation from China, the EU, and Japan drive uncertainty, boosting Gold demand. Weak US Dollar – The Dollar’s struggle supports Gold’s rise due to their inverse correlation. Gold’s Outlook – Uptrend may continue, but US jobs data could trigger profit-taking. Always trade with strict risk management. Your capital is the single most important aspect of your trading business.   Please note that times displayed based on local time zone and are from time of writing this report.   Click HERE to access the full HFM Economic calendar.   Want to learn to trade and analyse the markets? Join our webinars and get analysis and trading ideas combined with better understanding of how markets work. Click HERE to register for FREE!   Click HERE to READ more Market news.   Michalis Efthymiou HFMarkets   Disclaimer: This material is provided as a general marketing communication for information purposes only and does not constitute an independent investment research. Nothing in this communication contains, or should be considered as containing, an investment advice or an investment recommendation or a solicitation for the purpose of buying or selling of any financial instrument. All information provided is gathered from reputable sources and any information containing an indication of past performance is not a guarantee or reliable indicator of future performance. Users acknowledge that any investment in Leveraged Products is characterized by a certain degree of uncertainty and that any investment of this nature involves a high level of risk for which the users are solely responsible and liable. We assume no liability for any loss arising from any investment made based on the information provided in this communication. This communication must not be reproduced or further distributed without our prior written permission.
    • Date: 31st March 2025.   Trump Confirms Tariffs on All Countries, Sending Stocks Lower.   The NASDAQ continues to trade lower due to the US confirming the latest tariffs will be on all countries. In addition to this, bearish volatility also is largely due to the higher inflation data from Friday. The NASDAQ declines to its lowest price since September 11th 2024. Core PCE Price Index - Inflation Increases Again! The PCE Price Index read 2.5% aligning with expert forecasts not triggering any alarm bells. However, the Core PCE Price Index rose from 0.3% to 0.4% MoM and from 2.7% to 2.8% YoY, signalling growing inflationary pressure. This increases the likelihood that the Federal Reserve will maintain elevated interest rates for an extended period. The NASDAQ fell 2.60% due to the higher inflation reading which is known to pressure the stock market due to pressure on consumer demand and a more hawkish Federal Reserve. Boston Fed President Susan Collins recently commented that tariffs could drive up inflation, though the long-term impact remains uncertain. She told journalists that a short-term spike is the most probable outcome but believes the current pause in monetary policy adjustments is appropriate given the prevailing uncertainties. Although, certain investment banks such as JP Morgan actually believe the Federal Reserve will be forced into cutting rates. This is due to expectations that the economy will struggle under the new trade policy. For example, JP Morgan expects the Federal Reserve to delay rate cuts but will quickly cut towards the end of 2025. Market Risk Appetite Takes a Hit! A big factor for the day is the drop in the risk appetite of investors. This can be seen from the VIX which is up almost 6%, Gold which is trading 1.30% higher and the Japanese Yen which is the day’s best performing currency. Most safe haven assets, bar the US Dollar, increase in value. It is also worth noting that all indices are decreasing in value during this morning's Asian session with the Nikkei225 and NASDAQ witnessing the strongest decline. Previously the stock market rose in value as investors heard rumours that tariffs would only be on certain countries. This bullish swing occurred between March 14th and 25th. Over the weekend, President Donald Trump indicated that the upcoming tariffs would apply to all countries, not just those with the largest trade imbalances with the US. NASDAQ - Technical Analysis In terms of technical analysis, the NASDAQ continues to obtain indications that sellers control the price action. The price opens on a bearish price gap measuring 0.30% and trades below all Moving Averages on all timeframes. The NASDAQ also trades below the VWAP and almost 100% of the most influential components (stocks) are declining in value.     The next significant support level is at $18,313, and the resistance level stands at $20,367.95. Key Takeaway Points: NASDAQ falls to its lowest since September 2024 as the US confirms tariffs on all countries, adding to inflation concerns. Core PCE inflation rises to 0.4% MoM and 2.8% YoY, increasing the likelihood of prolonged high interest rates. Investor risk appetite drops as VIX jumps 6%, gold gains 1.3%, and safe-haven assets outperform. NASDAQ shows strong bearish momentum, trading below key technical levels with support at $18,313 and resistance at $20,367.95. Always trade with strict risk management. Your capital is the single most important aspect of your trading business.   Please note that times displayed based on local time zone and are from time of writing this report.   Click HERE to access the full HFM Economic calendar.   Want to learn to trade and analyse the markets? Join our webinars and get analysis and trading ideas combined with better understanding of how markets work. Click HERE to register for FREE!   Click HERE to READ more Market news.   Michalis Efthymiou HFMarkets   Disclaimer: This material is provided as a general marketing communication for information purposes only and does not constitute an independent investment research. Nothing in this communication contains, or should be considered as containing, an investment advice or an investment recommendation or a solicitation for the purpose of buying or selling of any financial instrument. All information provided is gathered from reputable sources and any information containing an indication of past performance is not a guarantee or reliable indicator of future performance. Users acknowledge that any investment in Leveraged Products is characterized by a certain degree of uncertainty and that any investment of this nature involves a high level of risk for which the users are solely responsible and liable. We assume no liability for any loss arising from any investment made based on the information provided in this communication. This communication must not be reproduced or further distributed without our prior written permission.
    • PM Philip Morris stock, top of range breakout at https://stockconsultant.com/?PM
    • EXC Exelon stock, nice range breakout at https://stockconsultant.com/?EXC
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.