Coding help - page 673

 
NWFstudent:

Hi dear programmers.

 

Im experimenting with mql4 to hopefully be a good programmer some day. My problem now has to do with measuring ticks/pips.

 

Im having a 5 digit broker and are using the following code:

 

 where: 

 

 

Of course this works on majors, but for example gold this will give me 1.5 pip instead of 15 and for dax it will give me 0.15pip instead

 

So I would want to multiply by 100 if the instrument is XAU/USD and by 1000 if the instrument is DE30.

 

How can I attack this problem? 

Try like this :

myPoint = MathPow(10,MathMod(_Digits,2))*_Point;
 
mladen:

Try like this :

Thank you allot mladen..
 

Could we assume for the loop

     for (r = 1; r <= N; r++){  ..........................  }

that N = 0, without any negative consequences (freezing, slowing down, etc.)? 

(of course, in that case the loop is ignored).  I would like to avoid unnecessary

'if'  condition.

 
wojtekpaul:

Could we assume for the loop

     for (r = 1; r <= N; r++){  ..........................  }

that N = 0, without any negative consequences (freezing, slowing down, etc.)? 

(of course, in that case the loop is ignored).  I would like to avoid unnecessary

'if'  condition.

wojtekpaul

It would not freeze or slow down the code

 
Thanks a lot, Professor.  :-)
 

Mladen

I was trying to install “UseReEntry”  as it used in the “RK-PrCh_Signal-1-nf” indicator (attached) into the volty channel v2 but failed miserably. It compiles but won’t give the reentry signal. Lines 219 & 224 are probably the problem.

V1 is the good working volty channel. Could you either install “UseReEntry”  in v1 or ,and this could take longer, fix v2.

 Appreciate any help

Ray

Attached files;

RK-PrCh_Signal-1-nf  --An example of what I’m looking to achieve

RK-volty channel stop mtf_alerts-v1 –Good working indicator

RK-volty channel stop mtf_alerts-v2-My feeble attempt

 
traderduke:

Mladen

I was trying to install “UseReEntry”  as it used in the “RK-PrCh_Signal-1-nf” indicator (attached) into the volty channel v2 but failed miserably. It compiles but won’t give the reentry signal. Lines 219 & 224 are probably the problem.

V1 is the good working volty channel. Could you either install “UseReEntry”  in v1 or ,and this could take longer, fix v2.

 Appreciate any help

Ray

Attached files;

RK-PrCh_Signal-1-nf  --An example of what I’m looking to achieve

RK-volty channel stop mtf_alerts-v1 –Good working indicator

RK-volty channel stop mtf_alerts-v2-My feeble attempt

Ray

bprice and sprice can not be used like that

Attached a version that has historical values for those two variables, and which you can now use for any comparison like in any buffer

 
mladen:

Ray

bprice and sprice can not be used like that

Attached a version that has historical values for those two variables, and which you can now use for any comparison like in any buffer

mladen

Thanks for your prompt answer. I still can't get the re-entry to even show in the data window. Could you please have a look at it again.


ray 

 
traderduke:

mladen

Thanks for your prompt answer. I still can't get the re-entry to even show in the data window. Could you please have a look at it again.


ray 

Ray

What exact conditions for that (the "re-entry") do you have in mind?

 
mladen:

Ray

What exact conditions for that (the "re-entry") do you have in mind?

Mladen

Sorry to be such a pain but as you probably can tell I intend to use it in an EA.

On a Buy or long position when the price or trend stales and then starts back up do a re-entry. See attached:


Reason: