Ok, this one has probaly been past a couple of times.
I want to store an indicator value and then reference this later on.
I understand from the error that the CrossesOver() method expects a priceplot and not a double value.
Ok fine, how do you solve this then?
Within Metastock I can do the below in a hart beat but this obviously is not for beginners..
Also apperciate links to sites where I can go through some source code that beginners can understand.
Thanks,
Robin
protectedoverridevoid Initialize()
{
Add(ATR(AtrValue));
CalculateOnBarClose = true;
}
///<summary>
/// Called on each bar update event (incoming tick)
///</summary>
protectedoverridevoid OnBarUpdate()
{
// Condition set 1
double dblPrevClose = Close[1];
double dblAtrVal = ATR(20)[1];
double dblTrigger = dblPrevClose + dblAtrVal;
// if (Close[0] > dblTrigger)
if (CrossAbove(Close[0], dblTrigger, 1)) --> This goes wrong!!
{
DrawArrowUp("My up arrow" + CurrentBar, false,0, 0, Color.Lime);
}
}
Comment