[WARNING CLOSED!] Any newbie question, so as not to clutter up the forum. Professionals, don't go by. Can't go anywhere without you. - page 313

 

Is there a correlator program with the SP500 Fuchs, it seems to have the eu and oil and other things going for it?

 

Experimented with the sound and added the following:


   while( i>=0) {

      if(High[ i]>High[ i+1]   ||   Low[ i]<Low[ i+1]) {
            if( i<=0) {
               if( AlertSound==true   &&   isNewBar()==true ) {
                  PlaySound( sell);
                  PlaySound( buy);
               }
            } // if(i<=0)
      }

   i--;


I was expecting "Sell" and then "Buy", but only "Buy" is heard.

- Is there any way to solve this problem using the same two wav files?



Thank you!





 
chief2000 >> :

Experimented with the sound, added the following:

I was expecting "Sell" and then "Buy", but only "Buy" is heard.

- Is there any way to solve this problem using the same two wav files?

>> Thank you!

if it's in the script put Sleep(1000); after PlaySound(sell); so it has time to play before you start the next one,

If it is in an inductor, then make a cycle delay.


>> the argument in Sleep, it's better to delay by the length of the sound.

 
Urain >> :

If it's in the script, put Sleep(1000); after PlaySound(sell); so it has time to play before you start the next one,

If it's in the turkey, make it cycle a delay.


Note, the argument in Sleep is in microseconds, it's better to delay it by the length of the sound.

I see the idea, thank you!

 

Hello.

Can you give me a hint, I can't figure something out: I want this function instead of the word "Hello"

ObjectSetText("Original", "Hello", 10, "Arial Bold", Red);

write the time in the terminal

int YY=TimeYear( TimeCurrent());

I understand that I need to move it to string type string value, but how to make it show the year and not "YY".

Thank you.

 
gvi2504 писал(а) >>

Hello.

Can you give me a hint, I can't figure something out: I want this function instead of the word "Hello"

ObjectSetText("Original", "Hello", 10, "Arial Bold", Red);

write the time in the terminal

int YY=TimeYear( TimeCurrent());

I understand that I need to translate it to string type string, but how can I get the year displayed instead of "YY".

Thank you.

translate to string using https://docs.mql4.com/ru/convert/TimeToStr

cut specific characters from the string using https://docs.mql4.com/ru/strings/StringSubstr

 
DDFedor >> :

translate to a string using https://docs.mql4.com/ru/convert/TimeToStr

cut certain characters from that string with https://docs.mql4.com/ru/strings/StringSubstr

Thank you very much. >> Everything is clear.

 
costy_ писал(а) >>

Hello.

Can you tell me please, I am running a tester on M5 and inserting an indicator with

iMA(NULL, TM, Factor, 0, Method _ Calculation _ MA, PRICE_MEDIAN, pos); (loop while(pos >= 0) )

TF is a timeframe equal to M60 and the indicator reads today's bars instead of the bars being tested.

How to implement reading of M60 of the period under test for the indicator?

I need to add time synchronization.

 

People, can you tell me what I'm doing wrong?

I'm trying to call the indicator:

z= iCustom (NULL,0,"Kon",10,0,0);

but it doesn't work! Am I making a mistake somewhere in the parameters? The code of indicator Kon below. Help!

#property copyright "Copyright © 2008, Dante Software"
#property link      ""

#property indicator_separate_window
#property indicator_buffers 3
#property indicator_level1 0.0
#property indicator_color1 Olive
#property indicator_color2 Blue
#property indicator_color3 Gray

double up[], dn[], ma[];
extern int periodMA=10;
int met=MODE_SMA;
int pH =PRICE_HIGH;
int pL = PRICE_LOW;

//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int init()
  {
   SetIndexBuffer(0, up);
   SetIndexStyle(0,DRAW_HISTOGRAM);
   SetIndexBuffer(1, dn);
   SetIndexStyle(1,DRAW_HISTOGRAM);
   SetIndexBuffer(2, ma);
   SetIndexStyle(2,DRAW_LINE);
   
//---- indicators
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| Custom indicator deinitialization function                       |
//+------------------------------------------------------------------+
int deinit()
  {
//----
   
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| Custom indicator iteration function                              |
//+------------------------------------------------------------------+
int start()
  {
   int r;
   int kBar = 1000;
//----
    for( r = kBar; r>=0; r--)
    {
      if (iClose(NULL,0, r)>=iOpen(NULL,0, r))
       { 
        up[ r] = (iHigh(NULL,0, r)-iLow(NULL,0, r));
        }
      if (iClose(NULL,0, r)<iOpen(NULL,0, r))
       { 
        dn[ r] = (iHigh(NULL,0, r)-iLow(NULL,0, r));
        }
        ma[ r] = iMA (NULL,0, periodMA,0, met, pH, r)-iMA (NULL,0, periodMA,0, met, pL, r);
   }
//----
   return(0);
  }
//+------------------------------------------------------------------+
 
kon12 >> :

People, can you tell me what I'm doing wrong?

I'm trying to call the indicator:

but it doesn't work! Am I making a mistake somewhere in the parameters? The code of indicator Kon below. Help!

I think you have a condition if (iClose(NULL,0,r)>=iOpen(NULL,0,r)), because of this the value is not assigned to the up buffer, which you have a zero number and from which you take value with iCustom

Reason: