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

    • Date: 22nd November 2024.   BTC flirts with $100K, Stocks higher, Eurozone PMI signals recession risk.   Asia & European Sessions:   Geopolitical risks are back in the spotlight on fears of escalation in the Ukraine-Russia after Russia reportedly used a new ICBM to retaliate against Ukraine’s use of US and UK made missiles to attack inside Russia. The markets continue to assess the election results as President-elect Trump fills in his cabinet choices, with the key Treasury Secretary spot still open. The Fed’s rate path continues to be debated with a -25 bp December cut seen as 50-50. Earnings season is coming to an end after mixed reports, though AI remains a major driver. Profit taking and rebalancing into year-end are adding to gyrations too. Wall Street rallied, led by the Dow’s 1.06% broadbased pop. The S&P500 advanced 0.53% and the NASDAQ inched up 0.03%. Asian stocks rose after  Nvidia’s rally. Nikkei added 1% to 38,415.32 after the Tokyo inflation data slowed to 2.3% in October from 2.5% in the prior month, reaching its lowest level since January. The rally was also supported by chip-related stocks tracked Nvidia. Overnight-indexed swaps indicate that it’s certain the Reserve Bank of New Zealand will cut its policy rate by 50 basis points on Nov. 27, with a 22% chance of a 75 basis points reduction. European stocks futures climbed even though German Q3 GDP growth revised down to 0.1% q/q from the 0.2% q/q reported initially. Cryptocurrency market has gained approximately $1 trillion since Trump’s victory in the Nov. 5 election. Recent announcement for the SEC boosted cryptos. Chair Gary Gensler will step down on January 20, the day Trump is set to be inaugurated. Gensler has pushed for more protections for crypto investors. MicroStrategy Inc.’s plans to accelerate purchases of the token, and the debut of options on US Bitcoin ETFs also support this rally. Trump’s transition team has begun discussions on the possibility of creating a new White House position focused on digital asset policy.     Financial Markets Performance: The US Dollar recovered overnight and closed at 107.00. Bitcoin currently at 99,300,  flirting with a run toward the 100,000 level. The EURUSD drifts below 1.05, the GBPUSD dips to June’s bottom at 1.2570, while USDJPY rebounded to 154.94. The AUDNZD spiked to 2-year highs amid speculation the RBNZ will cut the official cash rate by more than 50 bps next week. Oil surged 2.12% to $70.46. Gold spiked to 2,697 after escalation alerts between Russia and Ukraine. Heightened geopolitical tensions drove investors toward safe-haven assets. Gold has surged by 30% this year. Haven demand balanced out the pressure from a strong USD following mixed US labor data. Silver rose 0.9% to 31.38, while palladium increased by 0.9% to 1,040.85 per ounce. Platinum remained unchanged. 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.
    • A few trending stocks at support BAM MNKD RBBN at https://stockconsultant.com/?MNKD
    • BMBL Bumble stock watch, pull back to 7.94 support area with high trade quality at https://stockconsultant.com/?BMBL
    • LUMN Lumen Technologies stock watch, pull back to 7.43 support area with bullish indicators at https://stockconsultant.com/?LUMN
×
×
  • Create New...

Important Information

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