[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 807

 
granit77:
You probably have a draft or incomplete code. The indicator is hardwired and none of the external variables are used in the code.

What I downloaded is almost all of it. I only cut out the coordinates.
 
Dersu:
I've downloaded almost all of them. I only cut out the coordinates.

Something unfinished, but it works like this. Shows the difference between OBV and its smoothed line. Outputted the only parameter that affects something (degree of smoothing), nothing else to change.

//---- indicator settings
#property indicator_separate_window
#property indicator_buffers 1
#property indicator_color1 Silver
//---- indicator parameters
extern int SignalSMA=10;
//---- indicator buffers
double ind_buffer1[];
double ind_buffer2[];
double ind_buffer3[];
double ind_buffer4[];

//+------------------------------------------------------------------+
//| Custom indicator initialization 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("OBV_M");
//---- 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 1-st additional buffer
for(int i=0; i<limit; i++)
ind_buffer2[i]=iOBV(NULL, 0, PRICE_CLOSE, i);
//---- signal line counted in the 2-nd additional buffer
for(i=0; i<limit; i++) {
ind_buffer3[i]=iMAOnArray(ind_buffer2,Bars,SignalSMA,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);
}
//+------------------------------------------------------------------+
 

Thank you, granit77.

I have erased the parameter ("OBV_M") there, sorry.

I understand the situation in general and accept it.

And your first comment clarifies everything, it has given me the knowledge, thank you.

 
Checked it out - everything is OK.
 

Good day!

In the Experts tab I got this message "Experts are disabled because the account has been changed".

What's the reason, has anyone encountered this?


I decided to clarify it.

I got this message in both terminals of one and the same brokerage company.

One of them is demo account and the other one is real account.

 
When you change accounts on the terminal, EAs are blocked by default. Uncheck the box in Service-Settings-Advisors-Disable EAs when changing account.
 
Roger, but I didn't change the accounts.
 
Could this be due to the installation of another terminal of the same DC?
 
Can you tell me why sometimes when I try to create an order an error message 130. Although the stop is ok. of course, the Expert Advisor may be trying to place an order close to the market, but why the 130 error - how can I fight this?
 
T-G:
Can you tell me why sometimes when I try to create an order an error message 130. Although the stop is ok. of course, the Expert Advisor may be trying to place an order close to the market, but why the 130 error - how can I fight this?
Can you give me the code? And they will find the error... :)
Reason: