Any rookie question, so as not to clutter up the forum. Professionals, don't pass by. Nowhere without you - 6. - page 627
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
Can you give me a code example, I can't think of anything normal.
How to force price comparison ( for example: MarketInfo(Symbol(),MODE_BID ) by how much the price has risen above/lower since the price comparison started.
If I use Variables "A" and "B" with Bid, how can I force to update only Variable "B" and compare them further - otherwise they both will always have the same values.
Or maybe there are simpler built-in ways?
Can you give me a code example, I can't think of anything normal.
How to force price comparison ( for example: MarketInfo(Symbol(),MODE_BID ) by how much the price has risen above/lower since the price comparison started.
If I use Variables "A" and "B" with Bid, how can I force to update only Variable "B" and compare them further - otherwise they both will always have the same values.
Or maybe there are simpler built-in ways?
Time should be taken into account. Remember the time when the first Bid value was written and then compare it with the actual Bid value after a certain interval:
1. t=0; A=Bid; B=Bid; C=MathAbs(B-A);
2. t=10; B=Bid; C=MathAbs(B-A); A=Bid;
3. t=20; B=Bid; C=MathAbs(B-A); A=Bid;
...
B variable C will thus be the absolute value of the difference in Bid over the past 10 seconds.
Please advise - while debugging the program - in the debugger in the window "Expression values tracking" in the expressions writes "Expression could not be evaluated" while the values of
these expressions calmly pop up in the window called by the Alert function. The program works, the variables are assigned values and in the debugger they are not displayed as they can not be evaluated. How this can be?
The time has to be taken into account. Remember the time when the first Bid value was recorded, and then compare at a given interval with the actual Bid at that time:
1. t=0; A=Bid; B=Bid; C=MathAbs(B-A);
2. t=10; B=Bid; C=MathAbs(B-A); A=Bid;
3. t=20; B=Bid; C=MathAbs(B-A); A=Bid;
...
B variable C will thus be the absolute value of the difference of Bid in the past 10 seconds.
There is no reference to time. Time is the enemy here.
How without time?
There is no time reference. Time is the enemy here.
How without time?
You put a variable with the price value into OnInit, and it will be bound to the price during Expert Advisor start, then you can compare it with what you need
There is no time reference. Time is the enemy here.
How can you do without time?
You can't do without time on the tailrace, it's an inseparable part of the system, alas. Even in the question posed, time appears:
How to make price comparison ( for example: MarketInfo(Symbol(),MODE_BID ) how much higher/lower from the moment of price comparison.
The "moment" is time there, the initial reference point.
Can you give me a code example, I can't think of anything normal.
How to force price comparison ( for example: MarketInfo(Symbol(),MODE_BID ) by how much the price has risen above/lower since the price comparison started.
If I use Variables "A" and "B" with Bid, how can I force to update only Variable "B" and compare them further - otherwise they both will always have the same values.
Or maybe there are simpler built-in ways?
LastPrice=0;
NewPrise=0;
if(условие записи LastPrice && NewPrise==0){LastPrice = MarketInfo(Symbol(),MODE_BID);}
if(LastPrice > 0) { NewPrise = MarketInfo(Symbol(),MODE_BID);}
On the tailrace there is no time without time, it is an inseparable part of the system, alas. Even in this question time is present:
the "moment" there is the time, the starting point.
there is no time in forex.... there is a continuous series of expected states... (predictions)
But for a trader, between two expected states one hour may pass, another month, another seconds, or even a year... :-)))
it is his problem... the whole point of successful trading is to minimize the waiting period.... ( depending on what one is aiming for...)
Hi all. Question about IndicatorCounted():
Can I expect only two states in the loop:
1) initialization (static variables are reset and i points to the 2nd bar on the left);
2) the whole story is calculated (i=2);
And, actually, why i=2? I would understand i=1 or i=0, but why 2? Can I rely on that 2? =)
If not, what is the right way to do it. I have a chain calculation, so the same bar cannot be processed repeatedly.
...
Ok, I'll put the question another way. Straight to the point. Can I use a variable instead of IndicatorCounted()?
That is, is the primary initialization of stats and globals always the same as 0 from IndicatorCounted()?