![]() |
This website will be down for maintenance from Friday May 24th at 6PM MDT until Saturday May 25th at 11AM MDT. We apologize for the inconvenience. If you need assistance during this time, please email sales@ninjatrader.com
|
|||||||
| Strategy Development Support for the development of custom automated trading strategies using NinjaScript. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Senior Member
Join Date: Jun 2008
Posts: 159
Thanks: 0
Thanked 0 times in 0 posts
|
Hi.
My strategy when working with TWS do not print stop loss and profitt target on chart when stop loss or profit target is filled. This stop loss or profit target appear on chart when I reload the strategy. Buy and sell order are printed Ok. Same strategy if working with NT simulator acc print stop loss and profit target on chart, no problem. What colud be possible reason of this? Rgds Czarek |
|
|
|
|
|
#2 |
|
Senior Member
Join Date: Jun 2008
Posts: 159
Thanks: 0
Thanked 0 times in 0 posts
|
I will check my problem carrefully and I see that olny stop loss order are not printed. Trarget limit, buy to cover enter orders are OK. Only stop are not shown on chart. I use simple strategy made by strategy wizard.
This is stop loss code: protected override void Initialize() { SetStopLoss("", CalculationMode.Ticks, Stop1, false); SetProfitTarget("", CalculationMode.Ticks, Limit1); CalculateOnBarClose = true; } What colud be the possible reason for it? |
|
|
|
|
|
#3 |
|
Administrator
Join Date: Nov 2004
Location: Denver, CO, USA
Posts: 11,163
Thanks: 6
Thanked 45 times in 32 posts
|
Please enable "TraceOrders = true" in the Initialize() method, then inspect the output in the Output window to get an idea why this method may be ignored.
Ray
NinjaTrader Customer Service |
|
|
|
|
|
#4 |
|
Senior Member
Join Date: Jun 2008
Posts: 159
Thanks: 0
Thanked 0 times in 0 posts
|
Ray.
I enabled "TraceOrders = true. If I set stop and profit as show in former message stop loss orders are placed or filled there is nothing shown in Output window but orders are placed and executed by TWS. Only enteries and update on bar close are shown: 2008-8-20 8:41:00 Entered internal PlaceOrder() method at 2008-8-20 8:41:00: Action=Buy OrderType=Market Quantity=25,000 LimitPrice=0 StopPrice=0 SignalName='' FromEntrySignal='' If I stop loss and profit to each entry. Output window shows: 2008-8-20 9:16:00 Entered internal PlaceOrder() method at 2008-8-20 9:16:00: Action=SellShort OrderType=Market Quantity=25,000 LimitPrice=0 StopPrice=0 SignalName='' FromEntrySignal='' 2008-8-20 9:16:00 Entered internal SetStopTarget() method: Type=Stop FromEntrySignal='' Mode=Ticks Value=3 Currency=0 Simulated=False 2008-8-20 9:16:00 Entered internal SetStopTarget() method: Type=Target FromEntrySignal='' Mode=Ticks Value=7 Currency=0 Simulated=False But in both cases only entry orders are printed. Do you have any idea about possiblem reason?? Czarek |
|
|
|
|
|
#5 |
|
Administrator
Join Date: Nov 2004
Location: Denver, CO, USA
Posts: 11,163
Thanks: 6
Thanked 45 times in 32 posts
|
What instrument are you trading?
Ray
NinjaTrader Customer Service |
|
|
|
|
|
#6 |
|
Senior Member
Join Date: Jun 2008
Posts: 159
Thanks: 0
Thanked 0 times in 0 posts
|
I've just test it right now with 3 instruments MHI, EuroDollar and NQ. EuroDollar, MHI - both has same problem. The sample I send you before comes from Eurodollar.
NQ working OK. |
|
|
|
|
|
#7 |
|
Administrator
Join Date: Nov 2004
Location: Denver, CO, USA
Posts: 11,163
Thanks: 6
Thanked 45 times in 32 posts
|
Can you see if you have the same problem on ZS (SoyBeans)? Also, this is a live account and NOT an NT internal sim account such as SIM101?
Ray
NinjaTrader Customer Service |
|
|
|
|
|
#8 |
|
Senior Member
Join Date: Jun 2008
Posts: 159
Thanks: 0
Thanked 0 times in 0 posts
|
Ray.
I have tested 4 instruments NQ,MHI, EURUSD ans ZS with TWS connection. With Sim101 all of them print all orders on chart, no problem. With real account only NQ working properly. MHI, EURUSD and ZS print only entry ordres (Buy, Sell, ). StopLoss and ProfitTaget are not printed during strategy working. All orders apprared when I reload strategy. Do you have idea of possbile reason?? Czarek |
|
|
|
|
|
#9 |
|
Administrator
Join Date: Mar 2005
Location: Bamberg, Germany
Posts: 9,994
Thanks: 0
Thanked 6 times in 6 posts
|
This is a bug which will be fixed with next update (2-3 weeks from now).
Dierk
NinjaTrader Customer Service |
|
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Profit Target and Stop loss change the number of trades | ssierra | Strategy Development | 9 | 12-17-2010 04:32 AM |
| Strategy: Monitoring Stop-Loss and Profit Target Orders | NinjaTrader_Josh | Reference Samples | 0 | 02-23-2008 11:15 PM |
| Profit Target and Stop Loss not honored | pjwinner | Strategy Analyzer | 6 | 11-30-2007 09:45 AM |
| Stop Loss - profit target settings | deanldavis475 | Miscellaneous Support | 1 | 11-26-2007 07:31 AM |
| Default stop loss and profit target as GTC | equitydealer | General Programming | 4 | 06-18-2007 11:31 PM |