0

I have assertions in my code that is creating popups in my ninjatrader. how can i prevent the popups and send the same message to a log file?

case MarketPosition.Long:
                {
                    Trace.Assert(exitStopOrderLong!= null,"exitStopOrderLong is null");
                    Trace.Assert(exitStopOrderLong.OrderState==OrderState.Accepted,string.Format("exitStopOrderLong is in invalid state{0}",exitStopOrderLong.OrderState));
                    double stopPrice=Instrument.MasterInstrument.Round2TickSize(Low[1]) -Instrument.MasterInstrument.TickSize/2 ;
                    ChangeOrder(exitStopOrderLong, exitStopOrderLong.Quantity, 0, stopPrice);


                    break;
                }

http://i.imgur.com/vADbRMz.png

Adel Khayata
  • 2,717
  • 10
  • 28
  • 46
junkone
  • 1,427
  • 1
  • 20
  • 45

1 Answers1

0

the answer is much more simpler. add to the app.config and put the target logfilename.

http://msdn.microsoft.com/en-us/library/ty5e4c4h.aspx

junkone
  • 1,427
  • 1
  • 20
  • 45