View Full Version : I think i messed up my simulator data?
ohowie
01-23-2008, 04:08 PM
i was cruising along. Everything great. My strategy tested well. ran on charts great too. Then i
1. copied replay data from 6.0 to 6.5 (manually) (mistake)
2. ran replay of one day.
now my strategy does not produce any result other than banging into stop losses 1 min after entry. Strategy works fine on charts from beginning to end. I think I have corrupted the data the simulator uses. How can I reset this?
Thank you
Howie
NinjaTrader_Ray
01-23-2008, 04:18 PM
Delete any files you copied over and try it again.
ohowie
01-23-2008, 05:15 PM
it must be my code... it works fine on charts not the strategy optimizer.
last bit of ninja scripting included myVariable = CurrentBar then checking myVariable against future CurrentBar. Would CurrentBar have different behavior in simulator and live? thanks again Ray
ohowie
01-23-2008, 08:59 PM
This is the order trace... TrailStops were set in the initialization too.
Problem is only in Simulator. It stops after 1st position it looks like against the stop. in this case 80 pips.
Charts are fine.
Help! How can I get my Simulator Back?
Thanks,
Howie
10/9/2007 8:01:00 AM Entered internal PlaceOrder() method at 10/9/2007 8:01:00 AM: Action=SellShort OrderType=Market Quantity=0.01M LimitPrice=0 StopPrice=0 SignalName='SE1' FromEntrySignal=''
10/9/2007 8:01:00 AM Entered internal PlaceOrder() method at 10/9/2007 8:01:00 AM: Action=SellShort OrderType=Market Quantity=0.01M LimitPrice=0 StopPrice=0 SignalName='SE2' FromEntrySignal=''
EURUSD ENTER SHORT Tuesday10/9/2007 8:01:00 AM 40/80/80
10/9/2007 8:02:00 AM Cancelled pending exit order, since associated position is closed: Order='NT-00003/Back101' Name='Profit target' State=Working Instrument='$EURUSD' Action=BuyToCover Limit price=1.363 Stop price=0 Quantity=0.01M Strategy='LL' Type=Limit Tif=Gtc Oco='NT-00000' Filled=0 Fill price=0 Token='65b501b3cdd94cd0904b1ddc8ed7d96e' Gtd='12/1/2099 12:00:00 AM'
10/9/2007 8:02:00 AM Cancelled pending exit order, since associated position is closed: Order='NT-00002/Back101' Name='Trail stop' State=Working Instrument='$EURUSD' Action=BuyToCover Limit price=0 Stop price=1.4106 Quantity=0.01M Strategy='LL' Type=Stop Tif=Gtc Oco='NT-00000' Filled=0 Fill price=0 Token='c523558d986540c689289f29fc3aa090' Gtd='12/1/2099 12:00:00 AM'
10/9/2007 8:02:00 AM Cancelled pending exit order, since associated position is closed: Order='NT-00005/Back101' Name='Profit target' State=Working Instrument='$EURUSD' Action=BuyToCover Limit price=1.363 Stop price=0 Quantity=0.01M Strategy='LL' Type=Limit Tif=Gtc Oco='NT-00001' Filled=0 Fill price=0 Token='261f27cedf5b441b8a61de2a697fa0e7' Gtd='12/1/2099 12:00:00 AM'
10/9/2007 8:02:00 AM Cancelled pending exit order, since associated position is closed: Order='NT-00004/Back101' Name='Trail stop' State=Working Instrument='$EURUSD' Action=BuyToCover Limit price=0 Stop price=1.4106 Quantity=0.01M Strategy='LL' Type=Stop Tif=Gtc Oco='NT-00001' Filled=0 Fill price=0 Token='8c0fd6d06ebb4d0faca0c2f70a707b70' Gtd='12/1/2099 12:00:00 AM'
NinjaTrader_Josh
01-23-2008, 11:46 PM
By simulator are you referring to the Strategy Analyzer and backtesting or the Simulated Data Feed/Market Replay with forward testing?
Forward testing and backtesting will produce different results. http://www.ninjatrader-support.com/HelpGuideV6/DiscrepanciesReal-TimeVsBacktest.html
ohowie
01-24-2008, 12:05 AM
strategy analyzer and backtesting... all else is fine. including running the strategies on charts. i dont know if its the history data the strategy analyzer uses. is that possible? or is there something im missing programatically between the analyzer and live?
thanks josh
NinjaTrader_Josh
01-24-2008, 12:15 AM
The link I posted earlier describes the discrepancies you are seeing. The same code will behave differently in a backtest simply because of the nature of backtesting.
ohowie
01-24-2008, 12:59 AM
it was working properly. last minute changes involved CurrentBar which is all i can think of. should that have caused it to enter one position and fail? only in the strategy analyzer?
NinjaTrader_Josh
01-24-2008, 03:07 AM
Hard to generalize how your code will react. You will most likely need to debug it and see what exactly it is doing while keeping in mind the discrepancies discussed earlier.
ohowie
01-24-2008, 05:58 AM
After much testing and prints and debuging it apears that when run on a chart my settrailstops are working properly but when the same 1st position (there should be several) tested, the strategy analyzer immediately stops out my strategy analyzer position and exits the script without error. the last thing i did before this happened was to manually copy over stuff from version 6. there was also a hard reboot necessary. i could have harmed the history data. should i reset? is there a way to errase history data?
thanks for the help, Howie
ohowie
01-24-2008, 06:23 AM
OK guys i got one for you...
DrawTextFixed("U1",Math.Round(Position.GetProfitLoss(Close [0] ,PerformanceUnit.Currency)).ToString(),TextPositio n.TopRight);
Causes the Strategy Analyzer to terminate the script.
ohowie
01-24-2008, 07:11 AM
Surrounded DrawTextFixed statements with...
if (!Historical)
not only did my strategy analyzer come back to life its ripping!
Thanks for the attention
NinjaTrader_Dierk
01-24-2008, 07:13 AM
I suppose you are on latest 6.0.1000.8 or 6.5.0.6, correct?
ohowie
01-24-2008, 07:15 AM
6.5.0.6 is my version
NinjaTrader_Dierk
01-24-2008, 07:17 AM
Great. Any funny stuff in the logs?
ohowie
01-24-2008, 07:25 AM
this may be related.
1/24/2008 7:37StrategyError on calling 'OnBarUpdate' method for strategy 'LL': Object reference not set to an instance of an object.
NinjaTrader_Dierk
01-24-2008, 07:35 AM
The problem likely is different. A simple strategy holding only (!) this code lineDrawTextFixed("U1",Math.Round(Position.GetProfitLoss(Close [0] ,PerformanceUnit.Currency)).ToString(),TextPositio n.TopRight);
works no problem.
I suggest isolating the issue in your strategy further.