I'm having an issue with the MRO and trying to nail down the the proper variables in order to have an beginning and ending to draw a line. Because I'm using the MRO I can't just use the CurrentBar as my variable so I tried CurrentBar - barsAgo. Using the Print() (as I showed in the picture) I am indeed getting the right bar number to start and end the line (trust me on that), but when I plug those variables into a Drawline() or DrawDiamond() the lines and diamonds get placed at the very beginning of the chart. Can someone give me a clue as to why this is happening?
Thanks
if(start_of_A && CrossBelow(RSI(14,3), 50, 1)) { int barsAgo = MRO(delegate {return Stochastics(7, 14, 3).K[0] > 78 && Stochastics(7, 14, 3).K[0] < Stochastics(7, 14, 3).K[1] && Stochastics(7, 14, 3).K[1] > Stochastics(7, 14, 3).K[2];}, 1, 15); if(barsAgo > -1) { end_of_A = CurrentBar - barsAgo; DrawDiamond("End of A" + CurrentBar, true, end_of_A , High[end_of_A] + .05, Color.Green); DrawLine("A Line" + CurrentBar, start_of_A1, Low[ start_of_A1], end_of_A, High[end_of_A], Color.Red); Print(Time[0] + " start_of_A1 " + start_of_A1); Print(Time[0] + " High " + end_of_A); start_of_A = false; } }
Comment