View Single Post
  #4 (permalink)  
Old 07-16-2006, 05:42 AM
marketjouster marketjouster is offline
Junior Member
 
Join Date: Nov 2005
Location: Amman, Jordan
Posts: 22
marketjouster is on a distinguished road
How to reference the DiNapoli DPO in an expert?

Hello Jamrok,
This PM is concerning your post regarding the DiNapoli Detrend Price Oscillator. Hope you don't mind but thought you might not see the question if I posted it following your post of last May .

I'm trying the reference the DiNap DPO from an expert but don't know how to configure the line of code that follows, 'iCustom'. Would you know what I would include?

For example for reference to the custom indicator 'Stochastic DiNapoli" I would include the following;

double stom1 = iCustom(NULL,0,"StochasticDiNapoli", 12,6,7,MODE_EMA,0,MODE_MAIN,1);

On a related topic, do you know what phrase should be included in a similar expert reference to the 'Stochastic' indicator included with MT4, to require the Close/Close price field be used? It seems to default to low/high.

If you can help it will be appreciated,

- MJ

P.S.- The copy of the DiNapoli Price Detrend indicator code is below.
----------------------------------------

//+------------------------------------------------------------------+
//| DiNapoli Detrend Oscillator.mq4
//| Treberk, www.forex-tsd.com - Conversion only
//+------------------------------------------------------------------+

#property indicator_separate_window
#property indicator_buffers 1
#property indicator_color1 Blue



extern int x_prd=14;
extern int CountBars=300;
//---- buffers
double dpo[];
extern int MAPeriod=7;


//+------------------------------------------------------------------+
//| Custom indicator initialization function |
//+------------------------------------------------------------------+
int init()
{
string short_name;
//---- indicator line
IndicatorBuffers(1);
SetIndexStyle(0,DRAW_LINE);
SetIndexBuffer(0,dpo);
//----
return(0);
}
//+------------------------------------------------------------------+
//| DPO |
//+------------------------------------------------------------------+
int start()
{
if (CountBars>=Bars) CountBars=Bars;
SetIndexDrawBegin(0,Bars-CountBars+x_prd+1);
int i,counted_bars=IndicatorCounted();

//----
if(Bars<=x_prd) return(0);
//---- initial zero
if(counted_bars<x_prd)
{
for(i=1;i<=x_prd;i++) dpo[CountBars-i]=0.0;
}
//----
i=CountBars-x_prd-1;


while(i>=0)
{
dpo[i]=Close[i]-iMA(NULL,0,MAPeriod,MODE_SMA,0,PRICE_CLOSE,i);


i--;
}
return(0);
}
//+------------------------------------------------------------------+
Reply With Quote