Coding help - page 523

 

Hi Mladen,hi Mr.Tools,

i need some help. Is it possible to code this indi that it only shows signal at close of candle? Sometimes signals appear also in the middle of the newest candle and this is definitely too late. Is there a possibility to filter this out.

I would be very grateful and keep up this amazing work.

sma_crossover_justin.mq4

Thanks in advance

Vito

Files:
 

techmac,

Could you clarify, for the rest of us, which 'P-code' you mean, as there are 9 types?

https://en.wikipedia.org/wiki/P-code

Big Be

 

Topic started on Post 5212:

mladen:
Depends what do you consider a "%"

If it is position, then you do not have to order them.

If it is values, you have to do order them. One way of getting something similar to that would be this : https://en.wikipedia.org/wiki/Quantile .

Otherwise you would heave to have a double loop : first to determine the values and second to find the values of interest. Double loop is of n^n complexity and if you try to use it on a buffer off the whole history, you are risking terminal freezing

mladen,

Thanks for the tips. I then did 'research' and eventually stumbled across a reference to MT4's ArraySort() function /command. I think it will prove adequate, especially as I should be able to only update once per bar. I had no idea this existed. I learn commands on a "I need this" basis, rather than try to memorize the entire MQL Reference document.

Big Be

 
Big Be:
techmac,

Could you clarify, for the rest of us, which 'P-code' you mean, as there are 9 types?

https://en.wikipedia.org/wiki/P-code

Big Be
P-Code, short for pseudo code, was a Microsoft proprietary intermediate language. The term derives from UCSD p-System. The language provided an alternate binary format to machine code (called "native code" in relevant products) for any compiled binary (e.g. DLLs, ActiveX controls, or applications).

P-code is directed to an interpreter (terminal in mt4 case) between the machine code (assembler == exe, dll, and so on) and pseudo code that executes at about 1% speed of assembler or C/C++ compiled exe or dll code

As a test : compare a simple loop test written and compiled in C and MQL (make some BIG loop for C, or else you are going to miss execution time). P-code is intended to make things compatible over different operating systems and processors, but that was abandoned in any time critical application due to its very, very slow execution. Inventor of the concept was Donald Knuth way back in 1958

 

techmac,

That is remarkable information. It makes me wonder what computer languages they teach in Russia, that someone thought it was a good idea.

How did you determine it was P-code?

P.S. I can't do the loop test as I have not studied C.

Thanks,

Big Be

 
Big Be:
techmac,

That is remarkable information. It makes me wonder what computer languages they teach in Russia, that someone thought it was a good idea.

How did you determine it was P-code?

P.S. I can't do the loop test as I have not studied C.

Thanks,

Big Be

That is not a bad idea (the p-code and a p-code machine - it is a basis of a lot of very good things, and Donald Knuth is a real genius). Java is using that same principle, as an example.

The bad is how metatrader made it and that they did not make any API available at all (every normal trading platform has an API : tradestation, metastock, ninjatraded, ...). Only the "bright guys" from metatrader decided not to have API

 

Hello everyone, can you add an input parameter in this indicator

5_34_5.mq4

Files:
5_34_5.mq4  4 kb
 
tristantsh:
Hello everyone, can you add an input parameter in this indicator 5_34_5.mq4

tristantsh

That indicator uses 4 future bar values which makes it a repainter. Input parameters can be added but it will still remain a repainter

 

no problems mladen. And thanks for his quick reply

 
tristantsh:
no problems mladen. And thanks for his quick reply

I am afraid I do not understand the answer

Do you still want those input parameters even though it will still remain a repainting indicator?

Reason: