[ARCHIVE!] Any rookie question, so as not to clutter up the forum. Professionals, don't pass by. Can't go anywhere without you - 4. - page 220

 

Good evening.Please tell me how to have the coordinates of the straight line: datetime T11=D'2012.06.21 14:00';datetime T22=D'2012.06.27 14:00';double prv1=1.261421;double prv2=1.2506;

Calculate the price coordinate of this line, for zero bar. logic need to solve the system of equations:double Cv=prv2-(prv1-prv2)/(T11-T22)*(T22-Time[0]); but the calculated price is not correct, error 30-40 pips. I was told here that I need to convert the time in bars, but what will it give? double bar1=iBarShift(NULL,0,T11);

???

 
scar1k:

Good evening.Please tell me how to have the coordinates of the line: datetime T11=D'2012.06.21 14:00';datetime T22=D'2012.06.27 14:00';double prv1=1.261421;double prv2=1.2506;

Calculate the price coordinate of this line, for zero bar. logic need to solve the system of equations:double Cv=prv2-(prv1-prv2)/(T11-T22)*(T22-Time[0]); but the calculated price is not correct, error 30-40 pips. I was told here that I need to convert the time in bars, but what will it give? double bar1=iBarShift(NULL,0,T11);

???


double ObjectGetValueByShift( string name, int shift)
The function calculates and returns the price value for the specified bar (shift relative to the current bar). The price value is calculated using a linear equation using the first and second coordinates. Applies to trend lines and similar objects. You need to call GetLastError() function to get information about the error.
See also ObjectGetShiftByValue().
Parameters:
name - object name.
shift - Bar number.
Example:
 double price=ObjectGetValueByShift("MyTrendLine#123", 11);
 

Thank you very much r772ra has helped))

 
Aleksander:
Top...you've exceeded your question limit...and you're going straight to the Gob.
And when, can you come from there?)
 
and when you've spent all the money for every sneeze in your software :) - formulate your terms of reference and follow the link - there are programmers waiting for you - they will fulfill your every whim for your money...
 
Aleksander:
and when you've spent all the money for every sneeze in your software :) - formulate your terms of reference and follow the link - there are programmers waiting for you - they will fulfill your every whim for your money...
Yeah, right. So I have to slave for a long time))
 

you do the thinking yourself... ask yourself - what you want - can you do it with your hands? by repeating this or that...

If it's repetitive... ...then describe step by step what you do with your hands - all the operations - in the form of comments...

and then, just formulate these comments in µl...

 
Let's get our brains pumping. It's summer and they're liquefying, so we need to tone them up in winter))
 

Good afternoon,

Question: How can I reset the indicator buffer array?

 
Top2n:
Let's get our brains pumping. It's summer now, they are getting liquefied, in winter they need to be toned down)).
In my experience, the most effective way to find the errors is to print the error number in the comments followed by a visual run of the Expert Advisor. In the beginning it takes a lot of time, but then you quickly learn to do without errors. You can also exclude parts of the code with /* ... */ you can determine how the behaviour of the EA changes.
Reason: