Can any of you nimble programmers help me create a strategy that is stable? Its very simple with no order management, I just want an audio alert and an arrow when there is a divergence in GOM CD. The code below only works some of the time. I'm lost in programming. The arrows have never worked at all. I would like the arrows to plot if possible.
Also I would like to add this:
Percent Complete 85% - trigger the alert when 85% of the bar is complete. I did attempt to add this, but afterwards, it worked the first time and never again. In fact, no alerts would work after that so I had to delete all my strategies and start from scratch again. Here's the code I'm using:
///
/// This method is used to configure the strategy and is called once before any strategy method is called.
///
protected override void Initialize()
{
CalculateOnBarClose = true;
}
///
/// Called on each bar update event (incoming tick)
///
protected override void OnBarUpdate()
{
// Condition set 1
if (High[0] > High[1]
&& High[0] > High[2]
&& GomCD(GomCDCalculationModeType.BidAsk, GomCDChartType.NonCumulativeChart, GomFileFormat.Binary, GomFilterModeType.OnlyLargerThan, 1, false).DeltaValue[0]