Questions from a "dummy" - page 49

 

Hello!!! I have a question, for example if my EA is working on m5.I am calling the indicator via iCustom().The timeframe is forcibly tied to m5.Can I call the same indicator again for another timeframe.For this, other buffers, other inputs and outputs will be different magik.For this EA to work simultaneously on multiple timeframes.

ma1_handle= iCustom("EURUSD",PERIOD_M5,"Examples\\MACD.exe5"   ....
ma2_handle= iCustom("EURUSD",PERIOD_M15,"Examples\\MACD.exe5"    ....
 
uncleVic:
All "old" modules are in the process of being redesigned for the new wizard.
It would be better if the list of signal modules was the same as in the old wizard, so you wouldn't have to correct the code after creating an EA. I mean it is inconvenient when each indicator already contains several signals. But if they all were in order, for example: Signal of moving averages crossover, CCI divergence signal, etc. Then any beginner would be able to build an EA for sure.
 
Karlson:

Hello!!! I have a question, for example if my EA is working on m5.I am calling the indicator via iCustom().The timeframe is forcibly tied to m5.Can I call the same indicator again for another timeframe.For this, other buffers, other inputs and outputs will be different magik.For this EA to work simultaneously on multiple timeframes.

You can.
 
kirill-demo:
It would be better if the list of signal modules was the same as in the old wizard, so you wouldn't have to correct the code after creating an EA. I mean that it is inconvenient when each indicator already includes several signals. But if they all were in order, for example: Signal of moving averages crossover, CCI divergence signal, etc. In such a case, any beginner would surely be able to build an EA.
The inconveniences are apparent.
 

I started to study MQL5 (I've been dealing with the fourth one for half a year). I create an empty indicator by template and add to it one line:

Comment("low[1] = ", DoubleToString(low[1]);

I cast it to the minute EUR-dollar and see low[1] = 1.44938

I haven't seen this value since July...

What does this have to do with?


full code:

//+------------------------------------------------------------------+
//|                                                         test.mq5 |
//|                        Copyright 2011, MetaQuotes Software Corp. |
//|                                              http://www.mql5.com |
//+------------------------------------------------------------------+
#property copyright "Copyright 2011, MetaQuotes Software Corp."
#property link      "http://www.mql5.com"
#property version   "1.00"
#property indicator_chart_window
//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int OnInit()
  {
//--- indicator buffers mapping
   
//---
   return(0);
  }
//+------------------------------------------------------------------+
//| Custom indicator iteration function                              |
//+------------------------------------------------------------------+
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[])
  {
//---
   Comment("low[1] = ", DoubleToString(low[1]));
//--- return value of prev_calculated for next call
   return(rates_total);
  }
//+------------------------------------------------------------------+
 
look at the time of this low[1]
 
sergeev:

see the time of this low[1]

I see, 2011.07.27.


corrected for the moment with the line

ArraySetAsSeries(low, true);

does it turn out that in this case we have to explicitly specify the value of the flag at each call?

 
yes
 
Try low[rates_total-2]
 
sergeev:

yes
thanks for your help