Place something like this :
as the first line of the start routine
Hi mladen,
Thank you for your kind help.
Regards,
Anton
Place something like this :
Can give example to place it at cci indicator?
Thank Mladen
Can give example to place it at cci indicator? Thank Mladen
Something like this::::
//| CCI simple.mq4 |
//+------------------------------------------------------------------+
#property copyright "www,forex-tsd.com"
#property link "www,forex-tsd.com"
#property indicator_separate_window
#property indicator_buffers 1
#property indicator_color1 DimGray
//
//
//
//
//
extern int CCIPeriod = 14;
extern int CCIPrice = PRICE_TYPICAL;
extern double OverSold = -100;
extern double OverBought = 100;
double cci[];
double prices[];
//+------------------------------------------------------------------+
//| |
//+------------------------------------------------------------------+
//
//
//
//
//
int init()
{
IndicatorBuffers(2);
SetIndexBuffer(0,cci);
SetIndexBuffer(1,prices);
SetLevelValue(0,OverBought);
SetLevelValue(1,OverSold);
IndicatorShortName("CCI ("+CCIPeriod+")");
return(0);
}
//+------------------------------------------------------------------+
//| |
//+------------------------------------------------------------------+
//
//
//
//
int start()
{
If (AccountNumber()!=123456789) return(0);
int counted_bars=IndicatorCounted();
int i,k,limit;
if(counted_bars<0) return(-1);
if(counted_bars>0) counted_bars--;
limit = MathMin(Bars-counted_bars,Bars-1);
//
//
//
//
//
for(i=limit; i>=0; i--)
{
prices = iMA(NULL,0,1,0,MODE_SMA,CCIPrice,i);
double avg = 0; for(k=0; k<CCIPeriod; k++) avg += prices; avg /= CCIPeriod;
double dev = 0; for(k=0; k<CCIPeriod; k++) dev += MathAbs(prices-avg); dev /= CCIPeriod;
if (dev!=0)
cci = (prices-avg)/(0.015*dev);
else cci = 0;
}
return(0);
}Something like this::::
//| CCI simple.mq4 |
//+------------------------------------------------------------------+
#property copyright "www,forex-tsd.com"
#property link "www,forex-tsd.com"
#property indicator_separate_window
#property indicator_buffers 1
#property indicator_color1 DimGray
//
//
//
//
//
extern int CCIPeriod = 14;
extern int CCIPrice = PRICE_TYPICAL;
extern double OverSold = -100;
extern double OverBought = 100;
double cci[];
double prices[];
//+------------------------------------------------------------------+
//| |
//+------------------------------------------------------------------+
//
//
//
//
//
int init()
{
IndicatorBuffers(2);
SetIndexBuffer(0,cci);
SetIndexBuffer(1,prices);
SetLevelValue(0,OverBought);
SetLevelValue(1,OverSold);
IndicatorShortName("CCI ("+CCIPeriod+")");
return(0);
}
//+------------------------------------------------------------------+
//| |
//+------------------------------------------------------------------+
//
//
//
//
int start()
{
If (AccountNumber()!=123456789) return(0);
int counted_bars=IndicatorCounted();
int i,k,limit;
if(counted_bars<0) return(-1);
if(counted_bars>0) counted_bars--;
limit = MathMin(Bars-counted_bars,Bars-1);
//
//
//
//
//
for(i=limit; i>=0; i--)
{
prices = iMA(NULL,0,1,0,MODE_SMA,CCIPrice,i);
double avg = 0; for(k=0; k<CCIPeriod; k++) avg += prices; avg /= CCIPeriod;
double dev = 0; for(k=0; k<CCIPeriod; k++) dev += MathAbs(prices-avg); dev /= CCIPeriod;
if (dev!=0)
cci = (prices-avg)/(0.015*dev);
else cci = 0;
}
return(0);
}Thanks for help......I will try
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
hi coding expert friends,
Please help to advice : How to code in order to "limiting the license to certain account number only'?
i want to share a custome indi with my friend. I want to limit only working on his ACCOUNt Number. I dont want him to sell it.
Please help.
Thank you,
Anton