[WARNING CLOSED!] Any newbie question, so as not to clutter up the forum. Professionals, don't go by. Can't go anywhere without you. - page 806
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
THANK YOU for your attention, drknn.
extern int MagicNumber = 227 ; //Individual number //.
extern double Lots = 1 ; //minimal lot ///.
extern int Profit = 5000 ; // Take Profit //
extern inttern Loss = 10000 ; //Stop Loss //.
extern int Delta = 500 ;
extern int int Raznica = 700 ; //Stop Loss;
//--------------------------------------------------------------------------------//
extern string Indicator2 = "Bands" ; //
extern int int BandsPeriod = 20 ; // //period //
extern inttern Bands_shift = 0 ; //offset //
extern double Deviations = 2.0 ; // //
//--------------------------------------------------------------------------------//
extern int Slip = 5 ; //Slip ///////////////
int tick,tick2,go; // //
//--------------------------------------------------------------------------------//
int start() //
{ /////////////////////////////////
//---------------------------------------------------------------------------------------------------------------//
// Bands indicator //
//---------------------------------------------------------------------------------------------------------------//
double verhB=iBands(NULL,0,BandsPeriod,Bands_shift,Deviations,PRICE_CLOSE,MODE_UPPER,0);//calculate top line indicator//
double seredina=iBands(NULL,0,BandsPeriod,Bands_shift,Deviations,PRICE_CLOSE,0,0); //calculate the middle line indicator//
double nizB=iBands(NULL,0,BandsPeriod,Bands_shift,Deviations,PRICE_CLOSE,MODE_LOWER,0);//calculate bottom line indicator//
//---------------------------------------------------------------------------------------------------------------//
double slb,tpb,sls,tps;
double go=(verhB-nizB);
Alert ("verhB",DoubleToStr(verhB,Digits));
Alert ("nizB ",DoubleToStr(nizB,Digits));
slb=NormalizeDouble(Ask - (Loss*Point),Digits) ;
tpb=NormalizeDouble(Ask + (Profit*Point),Digits);
sls=NormalizeDouble(Bid + (Loss*Point),Digits) ;
tps=NormalizeDouble(Bid - (Profit*Point),Digits);
if(OrdersTotal()==0)
{
if(go<=Delta/10000)
Alert("Delta ", DoubleToStr(go,Digits)," is coming!!!");
tick =OrderSend(Symbol(),4,Lots,NormalizeDouble(Ask+Raznica*Point,Digits),Slip,slb,tpb,NULL,MagicNumber,0,CLR_NONE); //enter by/
if(tick<0) Print("Error # - ",GetLastError());
tick=OrderSend(Symbol(),5,Lots,NormalizeDouble(Bid-Raznica*Point,Digits),Slip,sls,tps,NULL,MagicNumber,0,CLR_NONE); //entry is set //
if(tick<0) Print("Error # - ",GetLastError());
}
return(0);}
Help me fix !!!! I've been messing around for a week!!! The point is that at a certain distance between the upper and lower limit of the Bollinger two pendants were put on stop buy and sell stop. I can not set the difference because writes that the upper and lower limit of the Bollinger price is the same .... Please help ......
You probably don't have a normalized lot, normalize it with:
You can't round a lot to digits!!!
don't look at comments to functions wrong
pay attention to
double verhB=iBands(NULL,0,BandsPeriod,Bands_shift,Deviations,PRICE_CLOSE,MODE_UPPER,0);//calculate top line indicator//
double seredina=iBands(NULL,0,BandsPeriod,Bands_shift,Deviations,PRICE_CLOSE,0,0); //calculate the middle line indicator//
double nizB=iBands(NULL,0,BandsPeriod,Bands_shift,Deviations,PRICE_CLOSE,MODE_LOWER,0);//calculate bottom line indicator //
swap them
I'm off topic! how to get Point = 0.00001 (5 digits) for alpari by standard means ???
Good afternoon
Who would look at the code of the indicator - it doesn't listen to the settings at all.
I'm not good at code
//---- indicator settings
#property indicator_separate_window
#property indicator_buffers 1
#property indicator_color1 Silver
//---- indicator parameters
extern int FastEMA=12;
extern inttern SlowEMA=26;
extern inttern SignalSMA=9;
//---- indicator buffers
double ind_buffer1[];
double ind_buffer2[];
double ind_buffer3[];
double ind_buffer4[];
//+------------------------------------------------------------------+
//| Custom indicator initialisation function |
//+------------------------------------------------------------------+
int init()
{
//---- 2 additional buffers are used for counting.
IndicatorBuffers(4);
//---- drawing settings
SetIndexStyle(0,DRAW_LINE);
SetIndexDrawBegin(0,SignalSMA);
IndicatorDigits(MarketInfo(Symbol(),MODE_DIGITS)+2);
//---- 3 indicator buffers mapping
if(!SetIndexBuffer(0,ind_buffer1) &&
!!SetIndexBuffer(1,ind_buffer2) &&
!SetIndexBuffer(3,ind_buffer4) &&
!SetIndexBuffer(2,ind_buffer3))
Print("cannot set indicator buffers!");
//---- name for DataWindow and indicator subwindow label
IndicatorShortName();
//---- initialization done
return(0);
}
//+------------------------------------------------------------------+
//| Moving Average of Oscillator |
//+------------------------------------------------------------------+
int start()
{
int limit;
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;
//---- macd counted in the 1st additional buffer
for(int i=0; i<limit; i++)
ind_buffer2[i]=iOBV(NULL, 0, PRICE_CLOSE, i);
//---- signal line counted in the 2nd additional buffer
for(i=0; i<limit; i++) {
ind_buffer3[i]=iMAOnArray(ind_buffer2,Bars,10,0,MODE_SMA,i);
ind_buffer4[i]=iMAOnArray(ind_buffer2,Bars,3,0,MODE_SMA,i);
}
//---- main loop
for(i=0; i<limit; i++)
ind_buffer1[i]=ind_buffer2[i]-ind_buffer3[i];
//---- done
return(0);
}
//+------------------------------------------------------------------+
xtern int FastEMA=12;
extern int SlowEMA=26;
extern int SignalSMA=9; These settings. Changes in the box do not lead to anything. The indicator line does not change.
The author has killed my request