Can someone please give a code snippet example of how to print a dot at the intersection of 2 MA crossovers.
Attached is a picture in another platform of what I would like to do. Just put dots at the crossover of 2 averages.
The script code for this is very simple one line and it just works flawlessly.
plot(cross(ma1, ma2) ? ma2 : na, color = (ma2 - ma1 > 0 ? fuchsia : blue) , style = circles, linewidth = 3)
The C# equivalent to this is proving to be quite a bit more involved. I've got the math figured out and am 70% there. Just trying to figure out why CrossAbove() and DrawDot() don't really behave.
Below is the basics of what I've been trying without luck. 2nd pic attached.
It just plots a dot at the fast MA line, but only to the far right and it keeps redrawing.
How do I get the dots to just plot and then stay at the crossover points like in the first picture?
if (codots != false)
{
if (CrossAbove(Values[1], Values[0], chanlen))
{
//DrawDot("Bull Dot", true, 0, Values[0][0], Color.Blue);
DrawDot("Bull Dot", true, 1, Values[0][0], Color.Blue);
}
}
Can someone provide a few lines of code to point me in the right direction. I see there's a few MACDBB type indicators based on ascending/descending slope in the sharing area but they don't have an example of what I need.
I'm hoping this is a very basic thing to do, but can't find a single code example Googling around.
Comment