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

 
AlexMikash:
Can I unload data from the terminal for processing in Excel?

Via ... ...you can. You got it wrong, through IE you can. Save the report open it in IE and convert it to Excell from there

I did it only once, so if something is wrong, do not hurt, maybe not remember something wrong.

 
AlexMikash:
Is it possible to unload data from the terminal for processing in Excel?

There are scripts for this, you can use F2 - export.
 
Thank you!)
 
tara:
My kid's at the flamenco rink dancing. Is that okay?

Boy, girl? How old?
 

I want to write an Expert Advisor on the "Supertrend" indicator.

But it is not built into MT4 and I don't know how to get data from the indicator.

May you help me with advice?

Here is the code of indicator "Supertrend".

//+------------------------------------------------------------------+
//|                                                   Supertrend.mq4 |
//|                   Copyright © 2005, Jason Robinson (jnrtrading). |
//|                                      http://www.jnrtrading.co.uk |
//+------------------------------------------------------------------+
#property copyright "Copyright © 2005, Jason Robinson (jnrtrading)."
#property link      "http://www.jnrtrading.co.uk"

#property indicator_chart_window
#property indicator_buffers 2
#property  indicator_color1 Lime
#property  indicator_color2 Red
#property  indicator_width1 2
#property  indicator_width2 2

double TrendUp[];
double TrendDown[];
int st = 0;
//extern int SlowerEMA = 6;

//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int init()
  {
//---- indicators

   //SetIndexStyle(0, DRAW_LINE, STYLE_SOLID, 2);
   SetIndexBuffer(0, TrendUp);
   //SetIndexStyle(1, DRAW_LINE, STYLE_SOLID, 2);
   SetIndexBuffer(1, TrendDown);
   
   /*SetIndexStyle(0, DRAW_ARROW, EMPTY);
   SetIndexArrow(0, 159);
   SetIndexBuffer(0, TrendUp);
   SetIndexStyle(1, DRAW_ARROW, EMPTY);
   SetIndexArrow(1, 159);
   SetIndexBuffer(1, TrendDown);*/
   
   /*for(int i = 0; i < Bars; i++) {
      TrendUp[i] = NULL;
      TrendDown[i] = NULL;
   }*/
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| Custom indicator deinitialization function                       |
//+------------------------------------------------------------------+
int deinit()
  {
//---- 
   /*for(int i = 0; i < Bars; i++) {
      TrendUp[i] = NULL;
      TrendDown[i] = NULL;
   }*/
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| Custom indicator iteration function                              |
//+------------------------------------------------------------------+
int start()
  {
   
   int limit, i, counter;
   double Range, AvgRange, cciTrendNow, cciTrendPrevious, var;

   int counted_bars = IndicatorCounted();
//---- check for possible errors
   if(counted_bars < 0) return(-1);
//---- last counted bar will be recounted
   if(counted_bars > 0) counted_bars--;

   limit=Bars-counted_bars;
   
   for(i = limit; i >= 0; i--) {
      cciTrendNow = iCCI(NULL, 0, 50, PRICE_TYPICAL, i);
      cciTrendPrevious = iCCI(NULL, 0, 50, PRICE_TYPICAL, i+1);
      
      //st = st * 100;
      
      counter = i;
      Range = 0;
      AvgRange = 0;
      for (counter = i; counter >= i-9; counter--) {
         AvgRange = AvgRange + MathAbs(High[counter]-Low[counter]);
      }
      Range = AvgRange/10;
      if (cciTrendNow >= st && cciTrendPrevious < st) {
         TrendUp[i+1] = TrendDown[i+1];
      }
      
      if (cciTrendNow <= st && cciTrendPrevious > st) {
         TrendDown[i+1] = TrendUp[i+1];
      }
      
      if (cciTrendNow >= st) {
         TrendUp[i] = Low[i] - iATR(NULL, 0, 5, i);         
         if (TrendUp[i] < TrendUp[i+1]) {
            TrendUp[i] = TrendUp[i+1];
         }
      }
      else if (cciTrendNow <= st) {
         TrendDown[i] = High[i] + iATR(NULL, 0, 5, i);
         if (TrendDown[i] > TrendDown[i+1]) {
            TrendDown[i] = TrendDown[i+1];
         }
      }
   }
//----
   return(0);
  }
//+------------------------------------------------------------------+
 
culler:

I want to write an Expert Advisor on the "Supertrend" indicator.

But it is not built into MT4 and I don't know how to get data from the indicator.

May you help me with advice?

Here is the code of indicator "Supertrend".


Data from the custom indicator is obtained using the iCustom function
 
alsu:

The data from the custom indicator is obtained using the iCustom function


I am just getting started with MQL4, I cannot figure out iCustom.

Could someone please help me to extract this data from the "Supertrend" indicator code above , so I can apply it to an Expert Advisor?

 
culler:


I'm just getting started with MQL4, I can't iCustom figure it out.

Could someone please help me pull the data from the "Supertrend" indicator code above , so I can use it in an Expert Advisor?


Well, you'll have to do it, what else could it be? If you want to write an Expert Advisor...

The Help has an example, do it like this: iCustom(symbol, timeframe, "Supertrend", you don't have special parameters, so let's skip this position, set the line number and the number of bar you need)

 

In the meta-iditor there is a prompt function, type the operator and press F1.it says everything you need to input the operator. it is done like this:

double UP=iCustom(Symbol(),NULL,"Supertrend",0,0);

double DOWN=iCustom(Symbol(),NULL,"Supertrend",1,0);
 
alsu:

Boy, girl? How old?

Girl, five years old.
Reason: