Hello,
Please help in editing code.
Needs to activate the acoustic / optical warning only once.
The code below works, unfortunately, when equity reaches the set Risk %, so the function PlaySound and Alert is activated when each tick, which do not.
I will be glad for any help. Please help me
I try for two weeks without result.Already I can not think of anything.
code:
extern bool Percent = true;
extern double Risk = 2.0;
int start()
{
//----
if (Percent == true)
double stop =AccountBalance()*(-Risk)/100;
double profit =AccountBalance()*(Risk)/100;
double floating_profit =AccountProfit();
{
if(StrToDouble(floating_profit) <= stop)
{
PlaySound("alert.wav");
Alert("Warning price: Stopp-loss "+Symbol()+" "+Hour()+":"+Minute()+":"+Seconds());
{
if(StrToDouble(floating_profit) >= profit)
PlaySound("alert.wav");
Alert("Warning price: Profit-target "+Symbol()+" "+Hour()+":"+Minute()+":"+Seconds());
}}}}
return(0);
}
Please help in editing code.
Needs to activate the acoustic / optical warning only once.
The code below works, unfortunately, when equity reaches the set Risk %, so the function PlaySound and Alert is activated when each tick, which do not.
I will be glad for any help. Please help me
I try for two weeks without result.Already I can not think of anything.
code:
extern bool Percent = true;
extern double Risk = 2.0;
int start()
{
//----
if (Percent == true)
double stop =AccountBalance()*(-Risk)/100;
double profit =AccountBalance()*(Risk)/100;
double floating_profit =AccountProfit();
{
if(StrToDouble(floating_profit) <= stop)
{
PlaySound("alert.wav");
Alert("Warning price: Stopp-loss "+Symbol()+" "+Hour()+":"+Minute()+":"+Seconds());
{
if(StrToDouble(floating_profit) >= profit)
PlaySound("alert.wav");
Alert("Warning price: Profit-target "+Symbol()+" "+Hour()+":"+Minute()+":"+Seconds());
}}}}
return(0);
}