Coding help - page 451

 
mladen:
I do not know which version was used to display like that, but it does not display like that in the old version of metatrader either (I tried it in build 432 too, and it displays exactly the same as in the new builds)

Don't know either which version was used on that image but in the code I see:

ObjectSetText("DR1","Daily R1: " + DoubleToStr(DR1,4));

So it should print text but it doesn't..

 

Hi.

If you were to write an EA, can the EA check the slope of an indicator? How are slope calculated, is it the derivative just like you would find the slope of any function to the power of something in math? Since the slope of an indicator is not a constant function I figure that it would be impossible to find the limit so what is the usual time frame to measure a slope? And what if it is a multi time-frame indicator which changes colour on direction.

Can you ask an EA to get the direction of a sloping indicator?

Thanks

Files:
sloep.png  55 kb
 
NWFstudent:
Hi.

If you were to write an EA, can the EA check the slope of an indicator? How are slope calculated, is it the derivative just like you would find the slope of any function to the power of something in math? Since the slope of an indicator is not a constant function I figure that it would be impossible to find the limit so what is the usual time frame to measure a slope? And what if it is a multi time-frame indicator which changes colour on direction.

Can you ask an EA to get the direction of a sloping indicator?

Thanks

Calculating slope is simple : if the current is greater then the previous value, slope is up. And the opposite.

The one that you are showing has a buffer called trend. Check if the current value of the trend buffer is different from the previous value - that means the trend changed. And if the trend buffer value is 1, the trend (slope) changed to up, if it is -1 it changed to down

You do not have to do anything special for multi time frame - just specify the desired time frame inn the second parameter of the iCustom() call, and all the rest is as any iCustom() call

 
mladen:
Calculating slope is simple : if the current is greater then the previous value, slope is up. And the opposite.

The one that you are showing has a buffer called trend. Check if the current value of the trend buffer is different from the previous value - that means the trend changed. And if the trend buffer value is 1, the trend (slope) changed to up, if it is -1 it changed to down

You do not have to do anything special for multi time frame - just specify the desired time frame inn the second parameter of the iCustom() call, and all the rest is as any iCustom() call

Thanks mladen.

If i get you right I can just call the buffer value and check if it is -1 or 1.

 
NWFstudent:
Thanks mladen. If i get you right I can just call the buffer value and check if it is -1 or 1.

Yes, that is right ...

 

Just a quick question.

In strategy tester there are some visual issues with some indicators. Should I worry about that or is it functioning properly.

Im asking to be sure if the entries made are correct or not.

Thanks

 
NWFstudent:
Just a quick question.

In strategy tester there are some visual issues with some indicators. Should I worry about that or is it functioning properly.

Im asking to be sure if the entries made are correct or not.

Thanks

NWFstudent

In visual testing you can not test any multi time frame indicator. That is an error of the new mt4. It used to work perfectly before some of the recent "upgrades". So, you should not worry if the issue is with the multi time frame indicator

 
mladen:
It seems to be working

What is the problem you are experiencing?

''

There are supposed to be 4 levels, it is not showing the top for some reason.

 
angrysky:
'' There are supposed to be 4 levels, it is not showing the top for some reason.

angrysky

Now all the levels are visible : 70-50_vol_breakout.mq4

 

How can I hide the zero level in the indicators that are in separate windows?

I was trying to find any option for that and could not find any

Reason: