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

 
snowman647 писал(а) >>
suggest if anyone has seen an advisor that just trades by render - any implementation... (it's supposed to just drain slowly at the expense of the spread)

Check out this option. http://vinin.ucoz.ru/forum/10-38-1

Last post

 

Citizens, who connected MT4 to Matlab via DDE, can you tell me why the connection is not initialized?

I write channel = ddeinit('MT4','BID');

in reply - channel = 0

Metatrader is running if anything.

 

Good afternoon.

Could you tell me please.

What should I change in the MA indicator, so that the line is drawn on the other side of the price? For example, if the price goes down, the indicator line is drawn on the right and if it goes up, it is drawn on the left.

How to do the opposite ?

 
smogsam писал(а) >>

Good afternoon.

Could you tell me please.

What should I change in the MA indicator so that the line is drawn on the other side of the price? For example, if the price goes down, the indicator line is drawn on the right and if it goes up, it is drawn on the left.

How to do it vice versa?

Probably, it is necessary to shift indicator for a period back to the past, but how much it should be shifted depends on the lag period of indicator. The SMA has half a period.

So, by moving SMA for a period backwards, it will be possible to see on history what you want.

 
Chemist >> :

Citizens, who connected MT4 to Matlab via DDE, can you tell me why the connection is not initialized?

I write channel = ddeinit('MT4','BID');

in reply - channel = 0

metatrader is running.

Have you enabled Service-Settings-Server-Enable DEE Server ?

You should.

 
Urain >> :

Have you enabled Service-Settings-Server-Enable DEE Server ?

Or else it should be.


That's it, this problem is solved. channel took the right value. now i'm trying to get the data

rc = ddeadv(channel, 'EURUSD','disp(x)','x',[1 1]); - trying to output the value of incoming tick to the console,

but it doesn't work, although rc=1. what's wrong, tell me?

 


Hello. I am struggling with the code of a custom indicator, based on DeMark's theory. The essence of the indicator - the way passed by the price (Close[i]-Open[i])/(High[i]-Low[i]) per unit time, for example a day, is multiplied by the volume of the same period. If the price goes up, the value of that value multiplied by the volume is added to the previous value. If the price goes down, the value of that day is subtracted from the previous day's value. In other words, positive values are added to the previous day's value and negative values are subtracted from the previous day's value. The ratio of positive and negative values of one period is the percentage value of buyer/seller pressure, in other words, accumulation/distribution of a security.

I only give the code of the special start function, because there is no problem with initialization of variables. When I run the code - at zero i iterations the indicator curve "goes" to the ceiling/half of the indicator window.

What I do wrong? How it should be done? Thanks for the help.


int start()
{
int i,j,nCountedBars;
double V,X,Y,Z;

if(Bars<=Fi) return(0);

nCountedBars=IndicatorCounted();
//----
i=Bars-Fi-1;
if(nCountedBars>Fi)
i=Bars-nCountedBars-1;
while(i>=0)
{
V=(Close[i]-Open[i])/(High[i]-Low[i]);
if(V>0)
X+=V*Volume[i];
else
Y+=V*Volume[i];



Alert("V=",V," X=",X," Y=",Y," i=",i);


ExtDMFiBuffer[i]=100-100/(1+MathAbs(X/Y));


i--;
}
return(0);
Files:
demarkrf.mq4  2 kb
 
Laven писал(а) >>

Hello. I am struggling with the code of a custom indicator, based on DeMark's theory. The essence of the indicator - the way passed by the price (Close[i]-Open[i])/(High[i]-Low[i]) per unit time, for example a day, is multiplied by the volume of the same period. If the price goes up, the value of that value multiplied by the volume is added to the previous value. If the price goes down, the value of that day is subtracted from the previous day's value. In other words, positive values are added to the previous day's value and negative values are subtracted from the previous day's value. The ratio of positive and negative values of one period is the percentage value of buyer/seller pressure, in other words, accumulation/distribution of this financial instrument.

Division by zero turns out.

If before any division we add the control on zero, it starts drawing.

But it would be necessary to modify the indicator logic. At every new tick the X and Y variables take on a value equal to zero. It works correctly on the history.

Files:
 
Laven писал(а) >>

Thank you. I will make sense of YOUR editorial. But

Still the curve of the graph goes to the "floor". Try your own.

I corrected the previous post. I also changed the file.

You may modify the indicator. But it will need additional buffers for intermediate calculations.

 
Vinin >> :

Division by zero works.

If you add a zero control before any division, it starts drawing.

But it would be necessary to rework the indicator logic. At every new tick the X and Y variables take values equal to zero. It works correctly on history

On the history? So, it turns out that today should be excluded from the calculations. Let's start with yesterday and i-- ?