Coding help - page 763

 

Hi Mladen,

I'm trying to put in my EA the MFI with MoveAverage  , and the MA is using "first indicator's data"...
I create this code and the MA is not getting data from the "first data indicator")

 

//--- inputs for expert
input ENUM_TIMEFRAMES                  Timeframe=PERIOD_CURRENT;//Timeframe
input string varname160="- - - - - - - - - - - - - - - - - -";//- - - Money Flow Index - - -
input int                              MFI_Period=14;                      //MFI Period
input ENUM_APPLIED_VOLUME              MFI_Volume=VOLUME_REAL;            //MFI Volume
input string varname200="- - - - - - - - - - - - - - - - - -";//- - - Média Móvel- - -
input int                              MA_Period=09;                    //MA period
input int                              MA_Shift=0;                      //MA shift
input ENUM_MA_METHOD                   MA_Method=MODE_SMA;              //MM Method
input ENUM_APPLIED_PRICE               MA_Price=PRICE_CLOSE;            //MM Price

//+------------------------------------------------------------------+
//| Global expert object                                             |
//+------------------------------------------------------------------+
   int               m_MFIHand;
   double            m_mfi0[1];
   double            m_mfi1[1];

   int               m_MAHand;
   double            m_ma00[];  


//+------------------------------------------------------------------+
//| Initialization function of the expert                            |
//+------------------------------------------------------------------+
int OnInit()
  {
   int temp=0;
      temp=(int)ChartGetInteger(0,CHART_WINDOWS_TOTAL);
      m_MFIHand=iMFI(_Symbol,Timeframe,MFI_Period,MFI_Volume);
      if(m_MFIHand!=INVALID_HANDLE)
        {
          ChartIndicatorAdd(0,temp,m_MFIHand);          
        }    

      m_MAHand=iMA(_Symbol,Timeframe,MA_Period,MA_Shift,MA_Method,MA_Price);
        {
          ChartIndicatorAdd(0,temp,m_MAHand);
        }    
  
  
   return(INIT_SUCCEEDED);
  }
//+------------------------------------------------------------------+
//| Deinitialization function of the expert                          |
//+------------------------------------------------------------------+
void OnDeinit(const int reason)
  {
  
  }

is really necessary to create a component to make MA get data from "first indicator's data"
or this can be done by code in the EA ?

could you help?

 
baraozemo:

Hi Mladen,

I'm trying to put in my EA the MFI with MoveAverage  , and the MA is using "first indicator's data"...
I create this code and the MA is not getting data from the "first data indicator")

 

//--- inputs for expert
input ENUM_TIMEFRAMES                  Timeframe=PERIOD_CURRENT;//Timeframe
input string varname160="- - - - - - - - - - - - - - - - - -";//- - - Money Flow Index - - -
input int                              MFI_Period=14;                      //MFI Period
input ENUM_APPLIED_VOLUME              MFI_Volume=VOLUME_REAL;            //MFI Volume
input string varname200="- - - - - - - - - - - - - - - - - -";//- - - Média Móvel- - -
input int                              MA_Period=09;                    //MA period
input int                              MA_Shift=0;                      //MA shift
input ENUM_MA_METHOD                   MA_Method=MODE_SMA;              //MM Method
input ENUM_APPLIED_PRICE               MA_Price=PRICE_CLOSE;            //MM Price

//+------------------------------------------------------------------+
//| Global expert object                                             |
//+------------------------------------------------------------------+
   int               m_MFIHand;
   double            m_mfi0[1];
   double            m_mfi1[1];

   int               m_MAHand;
   double            m_ma00[];  


//+------------------------------------------------------------------+
//| Initialization function of the expert                            |
//+------------------------------------------------------------------+
int OnInit()
  {
   int temp=0;
      temp=(int)ChartGetInteger(0,CHART_WINDOWS_TOTAL);
      m_MFIHand=iMFI(_Symbol,Timeframe,MFI_Period,MFI_Volume);
      if(m_MFIHand!=INVALID_HANDLE)
        {
          ChartIndicatorAdd(0,temp,m_MFIHand);          
        }    

      m_MAHand=iMA(_Symbol,Timeframe,MA_Period,MA_Shift,MA_Method,MA_Price);
        {
          ChartIndicatorAdd(0,temp,m_MAHand);
        }    
  
  
   return(INIT_SUCCEEDED);
  }
//+------------------------------------------------------------------+
//| Deinitialization function of the expert                          |
//+------------------------------------------------------------------+
void OnDeinit(const int reason)
  {
  
  }

is really necessary to create a component to make MA get data from "first indicator's data"
or this can be done by code in the EA ?

could you help?

Where are you exactly trying to use "first indicator's data"? As far as I see, it is not used (and it can not be used that way) since you can not pass "first indicator's data" that does not exist on the active chart. That mode is there exclusively for interactive work with charts not with EAs. Use average on array instead if you want to have average of some indicators data
 
mntiwana:
Use this of MRTOOLS corrected ver
Hello and sorry but I asked modified the indicator so that the arrows appear directly on the graph so the candle this indicator has nothing different from what I posted on my previous post if you please could change you it thanks
 
mladen:
Where are you exactly trying to use "first indicator's data"? As far as I see, it is not used (and it can not be used that way) since you can not pass "first indicator's data" that does not exist on the active chart. That mode is there exclusively for interactive work with charts not with EAs. Use average on array instead if you want to have average of some indicators data

Hi mladen,

yes I know that my sample is not working...  is necessary to create a component for this, correctly? could you help me to produce this?

MFI + MA (using "first indicator's data").

  

 
baraozemo:

Hi mladen,

yes I know that my sample is not working...  is necessary to create a component for this, correctly? could you help me to produce this?

MFI + MA (using "first indicator's data").

  

No. You must use ma on array. You can not do it the way you are trying to do it
 
mladen:
No. You must use ma on array. You can not do it the way you are trying to do it
yes.. could you give a sample ?
i look the mt4 version of OBV with MA with alert (that you created)..
  that could be adapted to MFI with MA.. but the problem is the mt4 version
 
baraozemo:
yes.. could you give a sample ?
i look the mt4 version of OBV with MA with alert (that you created)..
  that could be adapted to MFI with MA.. but the problem is the mt4 version
Please, use moving average on array (any moving average that can be applied to an array)
 
Dear mladen,

please indicator attached, made a dashboard for the M1 to H4, to complete my strategy ...

Thank you in advance
 

Hello nice people, i need a binary option EA to take trades on MT4 based brokers, I need to put my custom indicators there to test it in difrents pairs.

Time exp., ammount, maybe hours to trade, News, Steps Martingale. thanks apreciate your help. 

 

Please any coder help me to make arrow for this condition.

# Super trend arrow multiplier 0.3

# Super trend arrow multiplier 1.0

# Lwma cross arrow fast 1 / slow 2

If some one can make single arrow for this 3 arrow appear in same candle  time, that will be good accurate arrow.