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

    • UHS Universal Health Services stock, nice rally off the 197 support area, from Stocks to Watch at https://stockconsultant.com/?UHS
    • SGMO Sangamo Therapeutics stock, good start off 2 support area at https://stockconsultant.com/?SGMO
    • AAPL Apple stock, watch for a top of range breakout at https://stockconsultant.com/?AAPL    
    • Date: 26th November 2024. Trump’s tariff threats boosted Dollar; Peso, Loonie, Gold & Oil Lower. The Trump trade picked up steam as investors cheered his pick for Treasury Secretary, Scott Bessent. Beliefs he will be a steadying voice in the administration’s fiscal measures, while still following President-elect Trump’s tariff and tax commitments, underpinned. Asia & European Sessions:   Trump threatened on Monday to impose sweeping new tariffs on China, Canada and Mexico on his first day as US President to crack down on illegal immigration and drugs. He would impose a 25% tax on all products entering the country from Canada and Mexico, and an additional 10% tariff on goods from China as one of his first acts as president of the US. Bessent’s 3-3-3 plan aims to cut the deficit to 3% of GDP, boost growth to 3%, and increase oil production to 3 mln barrels. Treasury yields dove in a curve flattener, extending their drops through the session, on expectations inflation will decelerate. A strong 2-year auction also supported. The Dow led the charge, climbing 0.99% to 44,736, a new record peak as the rally broadens. The S&P500 climbed to 6020, a session peak, but finished with a 0.3% gain to 5987. The NASDAQ closed 0.27% higher. Today, stock markets in Europe are posting broad losses, with the DAX down -0.6%, the FTSE 100 0.4%, after a largely weaker close across Asia. ECB: Lane suggests ECB must be open-minded on speed of rate cuts. The ECB’s Chief Economist said in a speech on Monday evening that “remaining open-minded about the speed and scale of adjustments is in fact a valuable strategy across various environments, as different situations may necessitate distinct approaches.” This careful, step-by-step strategy enables us to observe the responses of the economy to our decisions and continuously refine our understanding of their impacts.” The comments leave the door open to a 50 bp move in December, but also tie in with our expectation that the central bank will deliver a 25 bp while tweaking the forward guidance and commit to additional moves. Financial Markets Performance: The USDIndex hit a session high of 107.50 and is currently lower at 106.85. Mexican peso and Canadian dollar slumped as the dollar is being viewed as a haven after the comments of President-elect Donald Trump on tariffs on Canada, Mexico and China. USDCAD spiked to 1.4177 and USDMXN rallied to 20.74. Oil and Gold lost ground, in part on cooling geopolitical risks, and on Trump trades. Oil dropped -3.03% to $69.09 per barrel, in part on the Trump trade and on talk of a potential cease fire between Israel and Hezbollah. Similarly, gold fell -3.26% to $2605 per ounce. 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. Andria Pichidi 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 FX and CFDs 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.
    • RYAM Rayonier Advanced Materials stock, nice trend with a pull back to 8.79 support area, bullish indicators at https://stockconsultant.com/?RYAM
×
×
  • Create New...

Important Information

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