A Green up arrow indicate to buy when a WICK REVERSAL candlestick appear
Condition:
1. The body is used to determine the size of the reversal wick. A wick that is 3.5 times larger than the size of the body.
2. The bullish reversal wick, the close of the bar fall within the top 25 percent of the overall range
If these 2 conditions is true, a green up arrow show under that candlestick to indicate buy.
I use the wizard to create a double called "ShadowFactor" and a double called "Closepercentage" and a Green Arrow plot.
Here is the code:
namespace NinjaTrader.Indicator { public class selfWichBullRev : Indicator { #region Variables // Wizard generated variables private double shadowFactor = 0.35; // Default setting for ShadowFactor private double closepercentage = 0.25; // Default setting for Closepercentage // User defined variables (add any user defined variables below) #endregion protected override void Initialize() { Add(new Plot(Color.FromKnownColor(KnownColor.SteelBlue), PlotStyle.TriangleUp, "PossibleBuy")); Overlay = false; } protected override void OnBarUpdate() { if (High[0] - Close[0] <= Closepercentage * (High[0] - Low[0]) && Math.Min(Open[0], Close[0]) - Low[0] > 100 * ShadowFactor * Math.Abs(Open[0] - Close[0]) ) {PossibleBuy.Set(Close[0]); } } #region Properties [Browsable(false)] // this line prevents the data series from being displayed in the indicator properties dialog, do not remove [XmlIgnore()] // this line ensures that the indicator can be saved/recovered as part of a chart template, do not remove public DataSeries PossibleBuy { get { return Values[0]; } } [Description("")] [GridCategory("Parameters")] public double ShadowFactor { get { return shadowFactor; } set { shadowFactor = Math.Max(0.01, value); } } [Description("")] [GridCategory("Parameters")] public double Closepercentage { get { return closepercentage; } set { closepercentage = Math.Max(0.01, value); } } #endregion } }
Line 62: Cannot implicitly convert type 'double' to 'int'
Line 62 is the
public double ShadowFactor
{
get { return shadowFactor; }
set { shadowFactor = Math.Max(0.01, value); }
}
Which is the wizard generate section and has nothing to do with me...
Please help me to find out where go wrong...
Thank
Comment