Have a look please to the following piece of code and I explain afterwards what the problem is.
if (State == State.SetDefaults)
{AddPlot(new Stroke(Brushes.Orange, 2), PlotStyle.TriangleUp, "Buys");
AddPlot(new Stroke(Brushes.Orange, 2), PlotStyle.TriangleDown, "Sells");}
protected override void OnBarUpdate()
{if (myCondition) Step1(Buys, Sells, value1);}
#region Helpers
int Step1(ref double[] array1, ref double[] array2, int value2)
{//myCode}
#endregion
1) Not valid arguments. (In the section "protected override void OnBarUpdate()")
2) Argument 1 and argument 2: Conversion of Ninjatrader.Ninjatrader.Series <douvle> in ref []double not possible.
I failed here to find a solution.
If the conversion of ref double[] array1 and ref double[] array2 to Buys and Sells is not possible, what could be the correct way to write the code in the section protected override void OnBarUpdate() oder in the section #region Helpers?
Thanks in advance!

Comment