[ARCHIVE!] Any rookie question, so as not to clutter up the forum. Professionals, don't pass by. Can't go anywhere without you - 4. - page 434

 

How do I get the beginning of the day's funds in my account?

 
Thank you!!!
 
Question on the function
PlaySound("mikhail_krug_-_zolotye_kupola_(zaycev.net)");

This is a sound file function, it seems to extract sound from a folder

if ( buf1[1]< buf2[1])  { B=-1;}  
  if ( buf1[1]> buf2[1])   {B=1;}
  if (vklutsili) {Bpomnim=B;vklutsili=false; }
  if (Bpomnim!=B) {Bpomnim=B;vklutsili=true; Print ( "  СОШЛОСЬ!!!!!!!!!!!!    " ,
   " buf1[0]  " ,  buf1[0]   ,  " buf2[0]  " , buf2[0]   );PlaySound("C:\Альпари\Sounds\mikhail_krug_-_zolotye_kupola_(zaycev.net)"); }
  
  
 
Dimka-novitsek:
Question on the function

This is a sound file function, it seems to extract sound from a folder


permission to add "C:\Alpari\Sounds\mikhail_krug_-_zolotye_kupola_(zaycev.net).mp3"

But the mp3 is unlikely to play, you need a wav.

 
Thank you!!!
 

Good day to all! Help with this problem, have an Expert Advisor (written by hand, please do not blame the curve) in tests worked out fine in real time does not open orders and no signs or errors, please help me ...

//+------------------------------------------------------------------+
//| |
//| Copyright 2012, MetaQuotes Software Corp.
//| http://www.metaquotes.net |
//+------------------------------------------------------------------+
#property copyright "Copyright 2012, MetaQuotes Software Corp.
#property link "http://www.metaquotes.net"

double ten;
double cena3;
double tp4;
int m=0;
int n=0;

//+------------------------------------------------------------------+
//| expert initialisation function |
//+------------------------------------------------------------------+
int init()
{
//----

//----
return(0);
}
//+------------------------------------------------------------------+
//| expert deinitialisation function |
//+------------------------------------------------------------------+
int deinit()
{
//----


//----
return(0);
}
//+------------------------------------------------------------------+
//| expert start function |
//+------------------------------------------------------------------+

int start()
{
//----
int tiket;

double Free =AccountFreeMargin();
double lot;
lot=(Free/1000/4);
if (TimeMinute(TimeCurrent())==m && TimeSeconds(TimeCurrent())==n)
{
RefreshRates();
x=Open[1];
t=High[1];
ten=NormalizeDouble (t,4)-NormalizeDouble (x,4);
cena3=NormalizeDouble (t,4)+0.0009;
tp4=NormalizeDouble (cena3,4)+0.0006;
if (NormalizeDouble (ten,4)==0.0024)
tiket=OrderSend(Symbol(),OP_BUYSTOP,lot, NormalizeDouble (cena3,4),3, 0, NormalizeDouble (tp4,4),NULL, 54321, iTime(Symbol(),PERIOD_D1,0)+23*60*60+59*60, CLR_NONE)
}
//----
return(0);
}
//+------------------------------------------------------------------+

 
stater:

Good day to all! Help with this problem, there is an Expert Advisor (written by hand, please do not blame for shoddy hands) on tests works fine in real time does not open orders and no signs or errors, please help ...



int start()
{
//----
int tiket;

double Free =AccountFreeMargin();
double lot;
lot=(Free/1000/4);//need to normalize to second digit
if (TimeMinute(TimeCurrent())==m && TimeSeconds(TimeCurrent())==n)//the first tick may not be
{
RefreshRates(); //surplus
x=Open[1];//where is it initialized?
t=High[1];//the same
ten=NormalizeDouble (t,4)-NormalizeDouble (x,4);
cena3=NormalizeDouble (t,4)+0.0009;
tp4=NormalizeDouble (cena3,4)+0.0006;
if (NormalizeDouble (ten,4)==0.0024)//it will be hard to catch the exact number
tiket=OrderSend(Symbol(),OP_BUYSTOP,lot, NormalizeDouble (cena3,4),3, 0, NormalizeDouble (tp4,4),NULL, 54321, iTime(Symbol(),PERIOD_D1,0)+23*60*60+59*60, CLR_NONE)
}
//----
return(0);
}
//+------------------------------------------------------------------+

 
Roger:


Roger Thank you so much!!! Already racked my brains as to what could be, now I'm going to try and rewrite it and see if it works!!!
 

Trying to write an indicator.

If the price on 4 bars in a row was the same, then colour it red.

If the price on only 2 bars in a row was the same, then I should colour it green.

But if the price on 4 bars is the same, then naturally it will be the same on 2 bars too. How do I divide them?

Thanks in advance for your help!

 
Egori4:

Trying to write an indicator.

If the price on 4 bars in a row was the same, then colour it red.

If the price on only 2 bars in a row was the same, then I should colour it green.

But if the price on 4 bars is the same, then naturally it will be the same on 2 bars too. How do I divide them?

Thanks in advance for your help!

if (цена на 4 барах подряд)
{
   // ставим красный цвет
}
else
{
   if (цена на 2 барах подряд)
   {
      // ставим зеленый цвет
   }
}