[ARCHIVE] Any rookie question, so as not to clutter up the forum. Professionals, don't pass by. Nowhere without you - 3. - page 430

 
sss2019:


I replaced the TimeCurrent variable type from datetime to int and it all worked, so there you go!

Maybe you can still tell me what OrderProfit is measured in and how to measure it in pips?

In currency of deposit

(Bid-OrderOpenPrice())/Point for Buy

(OrderOpenPrice()-Ask)/Point for Sell

 
sergeev:

Or maybe RTFM ?

No well RTFM is neither here nor there, but profit in pips is another matter.
artmedia70:

In currency of deposit

(Bid-OrderOpenPrice())/Point for Buy

(OrderOpenPrice()-Ask)/Point for Sell



Thanks
 
Lisi4ka330:
I don't need to change it, I need to open a position when the indicator (histogram) is green; close it when it is red....
For the sake of general understanding.
There is no pure colour in the code. The apparent colour change of a line or histogram is a superposition of two lines with the same values, each of which is drawn by its own buffer.
At the point of colour change, one buffer "disappears from view", that is, a null or empty(EMPTY_VALUE) value is assigned to it.
That is, it is enough to track through iCustom the values of the two buffers that make up the "two-colour" line. You can find the numbers of the necessary buffers by looking in the tab "Colours" in the properties of the indicator.
 
nadya:
Is there no other way but to refer to the colour? You probably know when your histogram is of a particular colour, don't you?
That's the thing, I don't know... the indicator is not cracked and its code is not known.... so what should I do if I only know the colour????
 
granit77:
For a general understanding.
There is no pure colour in the code. The apparent colour change of a line or histogram is a superposition of two lines with the same values, each drawn by a different buffer.
At the point of colour change, one buffer "disappears from view", that is, a null or empty (EMPTY_VALUE) value is assigned to it.
That is, it is enough to track through iCustom the values of the two buffers that make up the "two-colour" line. You can find the numbers of the necessary buffers by looking in the tab "Colours" in the properties of the indicator.
i.e. if the colour is green, then the value of the red line is 0, and vice versa....))) I will try it, thanks)))
 
chief2000:

Because you will only access TimeCurrent() once, and this command is the kind of thing that eats up your computer's resources (at least that's what I observed when I also used it a bunch of times).



A function is like a function. It eats no more than others. I mean, there are some very voracious ones, but this one isn't one of them.
 
Lisi4ka330:
Could you be more specific... Maybe it's simple for you, but I'm a 'beginner' and there's a lot I don't understand... In other words, if you cannot tell at what value the indicator is green, and at what value it is red, you cannot use this signal???? It would seem so simple, red - sell, green - buy, but you can not prescribe it.... yeah....

For each colour is responsible for its own buffer. It is always possible to determine when it is present and when it is absent. More precisely it is always possible to read values from a buffer and check them
 
Vinin:

Each colour has its own buffer. It is always possible to determine when a colour is present and when it is not. To be more precise, you can always read out the values from the buffer and check them
I see, thanks)))) either 0 or more than 0... I will try...
 
Lisi4ka330:
That's the thing, I don't know... the indicator is not hackable and its code is not known.... so what if I only know the colour????

Press Ctrl*I, double-click on the indicator name, enter the "Colours" tab and see which buffer corresponds to red and which to blue.

And take the values of these buffers by iCustom()

 
Lisi4ka330:
I see, thanks)))) either 0 or more than 0... will try...


not necessarily 0.

The empty value is set in the indicator with SetIndexEmptyValue() and can be any value.

Reason: