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

 
Can you tell me how many external variables can be set in MQL4? I remember seeing somewhere a long time ago that no more than 1024, but I'm not sure, that's why I'm asking.
 
charter:

I don't get it.

MA indicators

Or are they too good for you?

I need the OUTPUT CODE of technical indicator IMA, the indicator which is called in MetaTrader4 terminal by the tab "Indicators -> Trends -> Moving Average

Is it clearer now?

 
Leo59:

I need the INITIAL CODE of technical indicator IMA, the indicator which is called in MetaTrader4 terminal by the tab "Indicators -> Trends -> Moving Average

Is it clearer now?

Look at the MT4 or MT5 help and read the algorithm of calculation of MA and write your own code if you don't like the offered one.



 
AlexeyVik:

Call the MT4 or MT5 help and read the MA algorithm and write your own code if you don't like the one offered to you.



We can write our own code without any snotty advice, but it's a pity we have to reinvent bicycles and answer bums like you.
 
Leo59:
We can write without any snotty advice, but it's a pity about the time spent on reinventing bicycles and answering idlers like you.
Leonid. There is no need to be rude. The answer was to the question posed, nothing more. Maybe you should phrase your questions differently
 
Vinin:
Leonidas. There is no need to be rude. The answer was to the question posed, nothing more. Maybe you should phrase your questions differently.
Victor, you know perfectly well - there was no answer
 
Leo59:
Victor, you know very well - there was no answer
There was an answer to an incorrectly posed question
 

Hello!

I searched the forum and the internet, I couldn't find anything I needed, so I'm writing here.

I need a very simple EA (not a script) which would put a sellstop order on the selected pair (with any settings), if there are no orders on it.

I.e., the EA looks at the pair and checks if there are any orders, and if there are no orders, it places a sellstop (and if there are any orders, nothing is done) and so on until I turn it off.

I haven't dealt with MQL, but I think I can try to write it myself if somebody tells me where to read how to write such a condition (absence of other orders on a pair).

 
Makas:

Hello!

I searched the forum and the internet, I couldn't find anything I needed, so I'm writing here.

I need a very simple EA (not a script) which would put a sellstop order on the selected pair (with any settings), if there are no orders on it.

I.e., the EA looks at the pair and checks if there are any orders, and if there are no orders, it places a sellstop (and if there are any orders, nothing is done) and so on until I turn it off.

I haven't dealt with MQL, but I think I can try to write it myself if somebody tells me where to read how to write such a condition (absence of other orders on a pair).

Read
 
Leo59:

I need the INITIAL CODE of the IMA technical indicator, the indicator which is called in MetaTrader4 terminal under "Indicators -> Trends -> Moving Average" tab

Is it clearer now?

Why reinvent the wheel?

Make it like OsMA or any other code:

//+------------------------------------------------------------------+
//| Moving Average of Oscillator                                     |
//+------------------------------------------------------------------+
int OnCalculate (const int rates_total,
                 const int prev_calculated,
                 const datetime& time[],
                 const double& open[],
                 const double& high[],
                 const double& low[],
                 const double& close[],
                 const long& tick_volume[],
                 const long& volume[],
                 const int& spread[])
  {
   int i,limit;
//---
   if(rates_total<=InpSignalSMA || !ExtParameters)
      return(0);
//--- last counted bar will be recounted
   limit=rates_total-prev_calculated;
   if(prev_calculated>0)
      limit++;
//--- macd counted in the 1-st buffer
   for(i=0; i<limit; i++)
      ExtMacdBuffer[i]=iMA(NULL,0,InpFastEMA,0,MODE_EMA,PRICE_CLOSE,i)-
                    iMA(NULL,0,InpSlowEMA,0,MODE_EMA,PRICE_CLOSE,i);
//--- signal line counted in the 2-nd buffer
   SimpleMAOnBuffer(rates_total,prev_calculated,0,InpSignalSMA,ExtMacdBuffer,ExtSignalBuffer);
//--- main loop
   for(i=0; i<limit; i++)
      ExtOsmaBuffer[i]=ExtMacdBuffer[i]-ExtSignalBuffer[i];
//--- done
   return(0);
  }
//+------------------------------------------------------------------+

Or do you categorically not trust Metaquotes?

Reason: