if (strxav2 == "DT" && strxav1 == "DT")
if (strsingle == "MACD Cross DOWN")
if (Position.MarketPosition == MarketPosition.Flat)
{
Print("-----------RGAuto:" + strsingle);
Print("single:" + strsingle + " XAV1:" + strxav1 + " Xav2:" + strxav2);
{
int m = 0;
EnterShortStopLimit(0, true, 1, High[0] - 10 * TickSize, High[0] - 10 * TickSize, "DT+DT");//
RegistryKey key = Registry.CurrentUser.CreateSubKey(@"SOFTWARE\Ninja Trader7\MyScalper");
key.SetValue("Signalname", "DT+DT.Short");
key.Close();
}
}
But I found that only this condition was being adhered to and an order placed "if (strxav2 == "DT" && strxav1 == "DT")" it failed to catch the other two.
Is it possible that this will work;
if (strxav2 == "UT" && strxav1 == "UT") eventTotal++;
if (strsingle == "MACD Cross UP") eventTotal++;
if (Position.MarketPosition == MarketPosition.Flat) eventTotal++;
if (eventTotal == 3)
{
Print("-----------RGAuto:" + strsingle);
Print("single:" + strsingle + " XAV1:" + strxav1 + " Xav2:" + strxav2);
{
int n = 0;
EnterLongStopLimit(0, true, 1, High[0] + 2 * TickSize, High[0] + 2 * TickSize, "UT+UT");
RegistryKey key = Registry.CurrentUser.CreateSubKey(@"SOFTWARE\Ninja Trader7\MyScalper");
key.SetValue("signalname", "UT+UT.Long");
key.Close();
}
}
Do I need to place anything in protected override void Initialize() ?
Comment