Any rookie question, so as not to clutter up the forum. Professionals, don't pass by. Nowhere without you - 6. - page 251

 

Hello, I have a problem - when testing Expert Advisors on the currency pair audnzd I had to download quotes from the archive, but it did not work out well - the chart has become a "saw", with constant interruptions. Do you know how to fix it? Regards

 
SpikeOne:

Good afternoon people of the forum!

I am relatively new to trading on the exchange, only lost money, in general I decided to implement one idea, but to do this I need to know how to write code, mb it is already in the EAs, if anyone knows, guide me.

In general, the principle of martingale.

Opens on a sell or buy trade with sl and tp = 18

if it played in the + direction we instantly open one more position in the tp direction

if it played negatively, open a x2 position in sl direction after 15 seconds (if possible, this variable has to be set at the beginning)

All in all, if you will help it will be appreciated.


There is no need to spam.
 
Timofey:

Hello, I have a problem - when testing Expert Advisors on the currency pair audnzd I had to download quotes from the archive, but it did not work out well - the chart has become a "saw", with constant interruptions. Do you know how to fix it? Regards

i had to contact my broker and he gave me this link.
 
Which WinAPI call allows to run a command at the command line? I need to run a vbs-script from an indicator, the command there will be "cscript name_script.vbs".
 
gyfto:
Which WinAPI call allows to run a command at the command line? I need to run a vbs-script from an indicator, the command there would be "cscript name_script.vbs".

WinExec
 
gyfto:
Which WinAPI call allows to run a command at the command line? I need to run a vbs-script from an indicator, the command there would be "cscript name_script.vbs".
ShellExecuteA
 
Timofey:
I went to my broker and he gave me this link, it's like a developer's job.
It's the broker's job to give a good story. They are lazy and always blame the MCs.
 

The only thing I don't understand is how to calculate extrema of the MACD indicator, for example, instead of extrema of the price over n periods ?

//--------------------------------------------------------------------
// newbar.mq4  
// Предназначен для использования в качестве примера в учебнике MQL4.
//--------------------------------------------------------------------
extern int Quant_Bars=15;                       // Количество баров
bool New_Bar=false;                             // Флаг нового бара
//--------------------------------------------------------------------
int start()                                     // Спец. функция start
  {
   double Minimum,                              // Минимальная цена
          Maximum;                              // Максимальная цена
//--------------------------------------------------------------------
   Fun_New_Bar();                               // Обращение к ф-ии
   if (New_Bar==false)                          // Если бар не новый..
      return;                                   // ..то уходим
//--------------------------------------------------------------------
   int Ind_max =ArrayMaximum(High,Quant_Bars,1);// Индекс бара макс.ц. 
   int Ind_min =ArrayMinimum(Low, Quant_Bars,1);// Индекс бара мин. ц. 
   Maximum=High[Ind_max];                       // Искомая макс цена
   Minimum=Low[Ind_min];                        // Искомая мин. цена
   Alert("За последние ",Quant_Bars,            // Вывод на экран  
   " баров Min= ",Minimum," Max= ",Maximum);
   return;                                      // Выход из start()
  }
//--------------------------------------------------------------------
void Fun_New_Bar()                              // Ф-ия обнаружения ..
  {                                             // .. нового бара
   static datetime New_Time=0;                  // Время текущего бара
   New_Bar=false;                               // Нового бара нет
   if(New_Time!=Time[0])                        // Сравниваем время
     {
      New_Time=Time[0];                         // Теперь время такое
      New_Bar=true;                             // Поймался новый бар
     }
  }
//--------------------------------------------------------------------

I think I need to change HIGH and LOW to MACD in the key block... But I don't understand how ... all my attempts to goof around ended in nulling.

int Ind_max =ArrayMaximum(High,Quant_Bars,1);// Индекс бара макс.ц. 
int Ind_min =ArrayMinimum(Low, Quant_Bars,1);// Индекс бара мин. ц. 

I understand that I need to create a MACD array...

double MACDBuffer[];

I've also seen such a string in other Expert Advisors

void CalculateMACD(int i)
  {
   MACDLineBuffer[i] = iMACD(NULL, 0, 12,26,9,PRICE_CLOSE,MODE_MAIN,i);

but I can't just measure one on the other...

Please, advise how to do it?

 
lottamer:

The only thing I don't understand is how to calculate extrema of the MACD indicator, for example, instead of extrema of the price over n periods ?

I think I need to change HIGH and LOW to MACD in the key block... But I don't understand how ... all my attempts to goof around ended in nulling.

I understand that I need to create a MACD array...

double MACDBuffer[];

I've also seen such a string in other Expert Advisors

but I can't just measure one on the other...

Please, advise how to do it?

check out this article, it's not as simple as it sounds, and it's generally quite useful.
 
ALXIMIKS:
Look at this article, it's not as simple as it sounds, and it's generally quite useful.

I took a look. it will take me a week to study it in details. but what's worse, i couldn't find any places that would be related to my task. i don't color the indicators, and i don't modify them in any way. i just want to find highs and lows on n-last bars. there is a hint of similarity in RSI_Extremums_Sample.mq4 but i cannot do that code. there are many unnecessary things, the indicator draws.... and i don't need it...