Download MetaTrader 5
To add comments, please log in or register
Do you know C++? MQL5 has much in common with it. Just try it yourself!
NeilG
65
NeilG 2014.10.08 17:53 

Hi,

I'm stuck and would appreciate some assistance...

I'm trying to use iCustom in a EA.  I have to supply a shift as the last parameter of iCustom but I don't want to look at bars I've already processed.  I tried using the following:

void OnTick()
  {
   
   int counted_bars=IndicatorCounted();

Print("counted_bars=",counted_bars);
   if(counted_bars<0)
      return;
   if(counted_bars>0)
      counted_bars--;

... and then calling iCustom in a loop.  I assume because it is an EA, IndicatorCounted() returns -1 so the loop never enters.

How do I include iCustom in an EA and make sure I can send the proper shift value to iCustom?

Thanks,

Neil 

whroeder1
13596
whroeder1 2014.10.08 19:18  
snafu4: make sure I can send the proper shift value to iCustom?
  1. You decide what the proper shift must be. E.g. MA cross would be 1 and 2. Constant.
  2. Then call it. Detailed explanation of iCustom - MQL4 forum
NeilG
65
NeilG 2014.10.08 19:47  
WHRoeder:
snafu4: make sure I can send the proper shift value to iCustom?
  1. You decide what the proper shift must be. E.g. MA cross would be 1 and 2. Constant.
  2. Then call it. Detailed explanation of iCustom - MQL4 forum
... of course.  Thanks.  As I said, brain fart.
/
To add comments, please log in or register