i extracted the informatio from a Ray line I have drawn.
I am trying to get an angle on a daily chart then transfer the angle to a minute chart
dTicks = dRayStartPrice - dRayEndPrice; //y coordinates RISE
dTicks = dTicks / TickSize; // Divide by ticks for chart
nResTime = nRayStartBar - nRayEndBar; // x coordinate number of bars
dResAngle = dTicks / Convert.ToDouble(nResTime);
dResAngle = dResAngle/tChartTimeFrameInMinutes;
The chart time frame in minutes will find out the number of minutes if daily tcharttimeframe in minutes will be 1440
when my function loads the resangle it is supposed to draw
double dAnchor1 = 0;
double dAnchor2 = 0;
double dAnchor3 = 0;
// check chart time frame if daily or weekly
if (Regex.IsMatch(BarsPeriod.ToString(), "Daily") == true)
tChartTimeFrameInMinutes = 1440;
if (Regex.IsMatch(BarsPeriod.ToString(), "Weekly") == true)
tChartTimeFrameInMinutes = 10080;
DateTime tTempTime1 = tTime1;
DateTime tTempTime2 = tTempTime1.AddMinutes(tChartTimeFrameInMinutes);
dAnchor1 = Bars.GetOpen(Bars.GetBar(tTempTime1));
dAnchor2 = (dResAngle * TickSize) *tChartTimeFrameInMinutes+ dAnchor1;
dAnchor3 = -1 * (dResAngle * TickSize)*tChartTimeFrameInMinutes+ dAnchor1;
DrawRay("InverseAngle", false, tTempTime1, dAnchor1, tTempTime2, dAnchor2, Color.Red, DashStyle.Dash, 2);
DrawRay("AnchorLine", false, tTempTime1, dAnchor1, tTempTime2, dAnchor3, Color.Green, DashStyle.Dash, 2);
this.tagList.Add(new TachEonForceDrawList("InverseAngle"));
this.tagList.Add(new TachEonForceDrawList("AnchorLine"));
it works well if it stays on daily chart but when to a 1 minute it is totally off and not the correct angle
Comment