I used the arrowSeparation in my Fractals.It is not work very well. I also try to understand the "BillWilliams.mqh" .The code below is just get data set Symble and period. There is nothing about the arrow position.
The system Indicatro must create in a different way . If any one know something about it please tell me. Thanks.
//+------------------------------------------------------------------+//| Class CiFractals. |//| Purpose: Class of the "Fractals" indicator. |//| Derives from class CIndicator. |//+------------------------------------------------------------------+class CiFractals : public CIndicator
{
public:
CiFractals(void);
~CiFractals(void);
//--- method of creatingbool Create(conststring symbol,constENUM_TIMEFRAMES period);
//--- methods of access to indicator datavirtualdouble GetData(constint buffer_num,constint index) const;
double Upper(constint index) const;
double Lower(constint index) const;
//--- method of identifyingvirtualint Type(void) const { return(IND_FRACTALS); }
protected:
//--- methods of tuningvirtualbool Initialize(conststring symbol,constENUM_TIMEFRAMES period,constint num_params,constMqlParam ¶ms[]);
bool Initialize(conststring symbol,constENUM_TIMEFRAMES period);
};
//+------------------------------------------------------------------+//| Constructor |//+------------------------------------------------------------------+
CiFractals::CiFractals(void)
{
}
//+------------------------------------------------------------------+//| Destructor |//+------------------------------------------------------------------+
CiFractals::~CiFractals(void)
{
}
//+------------------------------------------------------------------+//| Create the "Fractals" indicator |//+------------------------------------------------------------------+bool CiFractals::Create(conststring symbol,constENUM_TIMEFRAMES period)
{
SetSymbolPeriod(symbol,period);
//--- result of initializationreturn(Initialize(symbol,period));
}
//+------------------------------------------------------------------+//| Initialize the indicator with universal parameters |//+------------------------------------------------------------------+bool CiFractals::Initialize(conststring symbol,constENUM_TIMEFRAMES period,constint num_params,constMqlParam ¶ms[])
{
return(Initialize(symbol,period));
}
//+------------------------------------------------------------------+//| Initialize the indicator with special parameters |//+------------------------------------------------------------------+bool CiFractals::Initialize(conststring symbol,constENUM_TIMEFRAMES period)
{
m_name="Fractals";
//--- okreturn(true);
}
//+------------------------------------------------------------------+//| Access to buffer of "Fractals" |//+------------------------------------------------------------------+double CiFractals::GetData(constint buffer_num,constint index) const
{
return(iFractals(m_symbol,m_period,buffer_num,index));
}
//+------------------------------------------------------------------+//| Access to Upper buffer of "Fractals" |//+------------------------------------------------------------------+double CiFractals::Upper(constint index) const
{
return(GetData(MODE_UPPER,index));
}
//+------------------------------------------------------------------+//| Access to Lower buffer of "Fractals" |//+------------------------------------------------------------------+double CiFractals::Lower(constint index) const
{
return(GetData(MODE_LOWER,index));
}
My way to learn code for mql4 is to recreate system default Indicator.
In William's Fractals .The green arrow is my fractals. The distance will change when chart scale changed.
But the System default Fractals always in a fixed position.
Is it possible for us to create a Arrow like the System default Indicator?
I used the arrowSeparation in my Fractals.It is not work very well. I also try to understand the "BillWilliams.mqh" .The code below is just get data set Symble and period. There is nothing about the arrow position.
The system Indicatro must create in a different way . If any one know something about it please tell me. Thanks.
ss