It seems the calculations should not be affected by the xy scales. The visual 
screen certainly is affected greatly, but calculating the angle should not be 
an issue.

Slope = (Yend - Ystart) / (Xend - Xstart)   where X is the bar number

This should work OK in any zoom setting, but only in one time frame at a time. 

Ara
  ----- Original Message ----- 
  From: ozzyapeman 
  To: [email protected] 
  Sent: Friday, August 08, 2008 3:22 PM
  Subject: [amibroker] X:Y Ration on a Chart


  Hoping someone can help me figure out how to fix the X:Y plotting ratio on a 
chart. 

  For example, if I wanted to find the slope or angle formed by the line drawn 
through the Last Close to the Close of Five Bars Ago,  that slope or angle 
would be very different if I was zoomed into the chart or zoomed out. 

  How can I fix the Y scale against the X scale of a chart in my AFL and make 
it exact, for the purpose of calculating these angles? I checked the Users 
Guide and don't see any obvious parameter or option I can set. 

  Right now, this is what I have at the top of my AFL to plot the chart:

  SetChartOptions(0,chartShowArrows|chartShowDates); 

  _N(Title = StrFormat("{{INTERVAL}} {{DATE}} Open %g, Hi %g, Lo %g, Close %g 
(%.1f%%) Vol " +WriteVal( V, 1.0 ) +" {VALUES}}", O, H, L, C, SelectedValue( 
ROC( C, 1 )) ));
   
  Plot( C, "Close", ParamColor("Color", colorBlack ), styleThick | 
ParamStyle("Style") | GetPriceStyle() );
   

Reply via email to