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

 
How to add horizontal lines in several graphs at once.Can be from a file, can be through a clipboard.
The structure of e.g:

EURUSD, 1.3000, RED
GBRUSD, 1.3000, RED
EURJPY, 1.3000, RED
EURUSD, 1.4000, blue
GBRUSD, 1.4000, Blue
EURJPY, 1.4000, Blue
EURUSD, 1.5000, green
GBRUSD, 1.5000, Green
EURJPY, 1.5000, Green

 

Faced with another problem, what is the error?

void Kof() // функция рисоования уровней
{
   int i;
   double summAUP;
   double summADN;
   double midle;
   double sr;

   for(i=0;i<iBars(pair,tf);i++) // считаем бары
   {
   
         
         if (Close[1]>BuferUp[i]) KoeF_UP[i] = HtUp[i]/(________________); 
         if (Close[1]<BuferDn[i]) KoeF_DN[i] = HtDn[i]/(________________);
         summAUP += KoeF_UP[i];
         summADN += KoeF_DN[i];
         sr = (summAUP+summADN)/2;

  DrawLabel("DN", summADN, 15,Yellow , 5);
  DrawLabel("UP", summAUP, 15, Aqua ,30);
  
         if (sr!=0) midle = Point*(HtUp[0]/sr)+BuferUp[0];
          
  DrawLabel("Midle", midle, 15, Red ,55);

   }
}
if (sr!=0) midle = Point*(HtUp[0]/sr)+BuferUp[0]; до этой строки все работает, если вместо midle в DrawLabel("Midle", midle, 15, Red ,55); записать sr Тоже все работает. 
А вот с предъявленным вариантом не хочет. В чем ошибка
 
eq003:
How to make multiple pending orders at once. May be from a file, may be via clipboard.
The structure is as follows:
pair, transaction, open price, SL, TP, expiry date
EURUSD, sell limit, 1.3000, 1.4000, 1.5000, 2013.02.06, 12:00 AM
GBRUSD, buy limit, 1.3000, 1.4000, 1.5000, 2013.02.06, 12:00
EURJPY ,sell limit, 1.3000, 1.4000, 1.5000, 2013.02.06, 12:00
EURJPY ,sell, 1.3000, 1.4000, 1.5000
Apart from the textbook, study the Documentation, it's all there.
 
berezhnuy:

Faced with another problem, what is the error?


Maybe try HtUp[i] and BuferUp[i] instead of HtUp[0] and BuferUp[i] ?
 
eq003:

I'm starting to read about MQL4, so I don't know anything.

Can I write an EA that always works on the same timeframe? For example, if my EA only opens trades on H1 Moving Average, but you are on H4 timeframe. That is, it is not clear how to get information about bars from H1. I think I can calculate the H1 MA from the minute ones.

Maybe there is an example?

The timeframe can be set by MQL in many technical indicators, no matter which one you are on. Lookhere for the second parameter: int timeframe.
 
eq003:

I'm starting to read about MQL4, so I don't know anything.

Can I write an EA that always works on the same timeframe? For example, if my EA only opens trades on H1 Moving Average, although you are on H4 timeframe. That is, it is not clear how to get information about bars from H1. I think I can calculate the MA H1 from the minute ones.


Maybe there is an example?

double iMA( string symbol, int timeframe, int period, int ma_shift, int ma_method, int applied_price, int shift)


Calculation of moving average.
Parameters:

symbol - symbol name of the symbol on whose data the indicator will be calculated. NULL means current symbol.

timeframe - Period. Can be one of the chart periods. 0 means the period of the current chart.

period - Averaging period for moving average calculation.

ma_shift - Shift of indicator relative to the price chart.

ma_method - Averaging method. Can be any of values of Moving Average methods.

applied_price - Price used. Can be any of price constants.

shift - Index of the value obtained from the indicator buffer (shift relative to the current bar by the specified number of periods back).


Example:
AlligatorJawsBuffer[i]=iMA(NULL,0,13,8,MODE_SMMA,PRICE_MEDIAN,i);
Put PERIOD_H1 as period parameter and you will get the MAA value from H1 timeframe, no matter what timeframe your EA/script/indyuctor is on...
 
001:
I'll try to build it in. An example would be similar...
Examples of how to use these functions are available from this author in particular - Korey.
 
pu6ka:

Instead of HtUp[0] and BuferUp[0], maybe try HtUp[i] and BuferUp[i] ?

That won't help(( well it didn't)
 
Hello. I'd like to know if there is a script or expert advisor that does all your actions in reverse, i.e. I press the buy button and the script opens sell, and I place a take and stop, respectively, also in reverse. I would like to use the script as an alternative to the above one. Thank you.
 
shuli:
Hello. I'd like to know if there is a script or expert advisor that does all your actions in reverse, i.e. I press the buy button and the script opens sell, and I place a take and stop, respectively, also in reverse. Thanks.
You have to do it vice versa yourself and you will be lucky!
Reason: