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

    • $CHWY Chewy stock breakdown watch, https://stockconsultant.com/?CHWY
    • $PYXS Pyxis Oncology stock low volume pullback to 4.32 support area, high trade quality, https://stockconsultant.com/?PYXS
    • $EVER EverQuote stock strong day, breakout, https://stockconsultant.com/?EVER
    • Date: 1st May 2024. Understanding the Implications of the FOMC Meeting. The FOMC will issue its post-meeting statement at 18:00 GMT tonight. “High-for-longer” is the expected outcome (but not higher) given more indications that progress on bringing inflation sustainably down to the 2% target has stalled out. With no new quarterly forecasts, it will be all about Chair Powell’s press conference when the Fed announces its policy stance tonight.   It is unlikely to be any more hawkish than what the markets are pricing in. Indeed, Chair Powell will have to acknowledge that the data are going the wrong way and he may even pre-empt the likely first question out of the box, “is a rate hike in the cards?” Meanwhile, Fed funds futures have not only fully priced out chances for a rate cut for this meeting and for June, but July as well. Risk for a reduction in September fell to below 50-50 on the initial spike in implied rates on the ECI news. The November contract reflects 20 bps in cuts, with a full quarter point easing now not seen until December. The FOMC is also expected to announce a slowing in Treasury runoff for June.   Economic Projections & Market Interpretation: The March update of the SEP revealed notable adjustments in key economic indicators. GDP forecasts for 2024 experienced a substantial upward revision, reflecting a more optimistic outlook with a growth rate of 2.1%, up from 1.4% in December. Similarly, projections for 2025 saw improvements, with the median jobless rate forecasts showing mixed trends but generally aligning with recent patterns. Expectations for headline and core PCE chain price indices also witnessed slight adjustments, indicating potential shifts in inflation dynamics. During the March meeting, the “dot plot” estimates hinted at a dovish stance by Fed members, with no indications of further rate hikes and median estimates suggesting potential rate cuts in 2024. This interpretation led markets to anticipate the initiation of quarterly rate cuts starting in June. As investors await the June SEP update, there is speculation about further adjustments in GDP estimates, PCE chain price indices, and the potential revision of rate cut expectations.   Analyzing the labor market reveals a complex picture of recovery and ongoing challenges. Payrolls have shown resilience in 2024, surpassing the previous year’s averages, albeit with variations across sectors. Despite improvements, the jobless rate remains a focal point, with fluctuations reflecting broader economic conditions. Additionally, metrics like the U-6 rate and wage growth provide insights into the labor market’s health and potential inflationary pressures.   Inflation Trends and Consumption Patterns: Inflation dynamics have been closely monitored, particularly amid recent fluctuations in commodity prices and supply chain disruptions. While recent CPI and PCE chain price measures suggest some moderation in inflationary pressures, concerns linger about the sustainability of these trends. The Fed’s attention to inflation remains paramount, shaping expectations for future policy actions. Consumer spending, a key driver of economic growth, has exhibited resilience despite ongoing uncertainties. Real personal consumption expenditures (PCE) have maintained positive growth rates, contributing to overall GDP expansion. However, shifts in consumption patterns and potential impacts on future economic performance warrant careful observation.   Market Expectations and Implications: As the FOMC meeting approaches, market participants are closely monitoring economic indicators and policy developments for insights into future market dynamics. The verbiage of the Fed statement and subsequent press briefing will be scrutinized for any hints regarding the timing of potential policy adjustments. Investors should remain vigilant and adaptable, considering the evolving economic landscape and its implications for investment strategies. The upcoming FOMC meeting holds significant implications for investors and economic stakeholders. Understanding recent economic developments, market expectations, and potential policy shifts is essential for navigating the dynamic financial environment. By staying informed and proactive, investors can position themselves to capitalize on emerging opportunities while managing risks effectively. 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 on how markets work. Click HERE to register for FREE! Click HERE to READ more Market news. Andria Pichidi Market Analyst 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.
    • $MRO Marathon Oil stock moving higher off the 27.57 support area, https://stockconsultant.com/?MRO
×
×
  • Create New...

Important Information

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