PDA

View Full Version : this should be working


crunchy
04-14-2010, 09:21 PM
Hi Support,

This is realy strange, sometime I get output and sometimes not!
I am absolutely sure their is nothing wrong with the code,
could you help please?
If I only have 1 to 2 print command then it works,then I introduce more print commands, then its not working, that simply does not make any sence.

Best regards
Crunchy

int idx= 0;
idx =S.IndexOf("gbpusd") ;
if (idx > 0 ){
Print("yes");
Print (idx);
String Ticket=null;
String Amount=null;
String Type=null;
String SL=null;

Ticket = S.Substring(7, 9);
Print (Ticket);
Amount = S.Substring(39, 5);
Print (Amount);
Type = S.Substring(27,3);
Print (Type);
SL = S.Substring(62,5);
Print (SL);
String Symb = null;
Print (Instrument.FullName);
Symb =(Instrument.FullName);
Symb = Symb.ToLower();
Symb = Symb.Substring(1,6);
Print (Symb);
idx =S.IndexOf("gbpusd") ;
String SL=null;
SL = S.Substring(62,5);
Print (SL);
String Symb = null;
Print (Instrument.FullName);
Symb =(Instrument.FullName);
Symb = Symb.ToLower();
Symb = Symb.Substring(1,6);
Print (Symb);
}

NinjaTrader_Bertrand
04-15-2010, 04:47 AM
crunchy, any log errors as you run this script? How did you define S?

You would likely need to simplify as much as possible and then work from a version where you know the prints are issued as you would expect, it's likely a sign your conditions for doing so are not hitting all the time you expect.