No overload for method "barvolume" takes 0 arguments. CS1501
namespace NinjaTrader.NinjaScript.Indicators
{
public class JBSwingbars : Indicator
{
SMA _volsma;
VOL _volume;
protected override void OnStateChange()
{
if (State == State.SetDefaults)
{
Description = @"Plots a dot at an area where HH/HL transitions to LH/LL.";
Name = "JBSwingbars";
Calculate = Calculate.OnBarClose;
IsOverlay = false;
DisplayInDataBox = true;
DrawOnPricePanel = true;
DrawHorizontalGridLines = false;
DrawVerticalGridLines = false;
PaintPriceMarkers = true;
ScaleJustification = NinjaTrader.Gui.Chart.ScaleJustification.Right;
//Disable this property if your indicator requires custom values that cumulate with each new market data event.
//See Help Guide for additional information.
IsSuspendedWhileInactive = true;
AddPlot(new Stroke(Brushes.DodgerBlue, 2), PlotStyle.Dot, "Buy");
AddPlot(new Stroke(Brushes.Red, 2), PlotStyle.Dot, "Sell");
int _currentplot;
int _lastplot;
}
else if (State == State.Configure)
{
AddDataSeries(Data.BarsPeriodType.Day, 1);
_volume = VOL();
_volsma = SMA(_volume,576); // SMA on volume for the past 2 days on 5min chart
}
}
protected override void OnBarUpdate()
{
// Check to make sure there are enough bars on chart.
if (base.CurrentBar < 576)
{
return;
}
// If the volume is not greater than moving average during then do not trade.
if (barvolume() == false)
{
return;
}
// If current bar shows sell signal plot a red dot.
if (_currentplot != _lastplot && _currentplot == -1)
{
// place code here to draw dot on chart.
}
// If current bar shows a buy signal plot a blue dot.
if (_currentplot != _lastplot && _currentplot == 1)
{
// place code here to draw dot on chart.
}
}
#region methods
bool barvolume(double _volume, double _volsma) //If the volume is not above the SMA do not plot a dot.
{
get {return _volume > _volsma;}
}
#endregion


Comment