Givin error codes

4 views
Skip to first unread message

Kekkis

unread,
Jul 9, 2007, 7:19:27 PM7/9/07
to topdog
This gives error codes, is your exellent idea of translator for
NinjaTrader 5.
Here is generated code, its smoothed rsi from mesasoftware.com
I found for loop is not ; and properties have changed. NT6
Its gives errors

Thanks


---------------
#region Using declarations
using System;
using System.ComponentModel;
using System.Diagnostics;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.Xml.Serialization;
using NinjaTrader.Cbi;
using NinjaTrader.Data;
using NinjaTrader.Indicator;
using NinjaTrader.Strategy;
#endregion

// This namespace holds all strategies and is required. Do not change
it.
namespace NinjaTrader.Strategy
{
/// <summary>
/// SMOOTH RSI ehlers
/// </summary>
[Description("SMOOTH RSI")]
[Gui.Design.DisplayName("SRSI")]
public class SRSI : Strategy
{
#region Variables
private DataSeries sym7;
private bool[] init_once;
private DataSeries sym8;
private int Len = 10;
private DataSeries sym1;
private DataSeries sym2;
private double count;
private DataSeries sym3;
private DataSeries sym4;
private double SRSIX;
private DataSeries sym5;
private double CD23;
private DataSeries sym6;
private double CU23;
private double Smooth23;
#endregion


protected double PointSize(int bip)
{
return BarsArray[bip].Instrument.MasterInstrument.PointValue;
}

protected void OnFirstBar(int bip)
{

count = 0;
Smooth23 = 0;
CU23 = 0;
CD23 = 0;
SRSIX = 0;
sym1 = new DataSeries(this);
sym2 = new DataSeries(this);
sym3 = new DataSeries(this);
sym4 = new DataSeries(this);
sym5 = new DataSeries(this);
sym6 = new DataSeries(this);
sym7 = new DataSeries(this);
sym8 = new DataSeries(this);
}

protected override void Initialize()
{
Bars.
init_once = new bool[Bars.Count];
foreach (bool elem in init_once)
elem = false;
}

protected override void OnBarUpdate()
{
int bip = BarsInProgress;
if (!init_once[bip])
{
OnFirstBar(bip);
init_once[bip] = true;
}

Smooth23 = (Close[0] + 2 * Close[1] + 2 * Close[2] + Close[3]) / 6;
CU23 = 0;
CD23 = 0;
sym1.Set(Smooth23);
sym2.Set(Smooth23);
sym3.Set(Smooth23);
sym4.Set(Smooth23);
sym5.Set(Smooth23);
sym6.Set(Smooth23);
sym7.Set(Smooth23);
sym8.Set(Smooth23);
for (double count = 0; count <= Len - 1;count++)
{
if (sym4[count] > sym3[count + 1])
{
CU23 = CU23 + sym2[count] - sym1[count + 1];
}
if (sym8[count] < sym7[count + 1])
{
CD23 = CD23 + sym6[count + 1] - sym5[count];
}
}
if (CU23 + CD23 != 0)
{
SRSIX = CU23 / (CU23 + CD23);
}
PlotC(1, SRSIX, "SRSI");
}
#region Properties

[Description("")]
[Category("Parameters")]
public int len
{
get { return len; }
set { Len = Math.Max(1, value); }


}

#endregion
}

}

Joel Reymont

unread,
Jul 10, 2007, 4:25:19 AM7/10/07
to top...@googlegroups.com
Kekkis,

What is the strategy that you are trying to translate?

Feel free to email me privately.

Thanks, Joel

--
http://topdog.cc - EasyLanguage to C# compiler
http://wagerlabs.com - Blog

Reply all
Reply to author
Forward
0 new messages