Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Where to start if I want to create a strategy on a trading set-up?
Collapse
X
-
If you're selling short below the current market price I believe you will want to use a sell stoplimit and not a limit order as a limit order. To better illustrate what is happening try placing a Sim sell limit order below the market price on the SuperDOM. You will see that the order is instantly filled as a market orderOriginally posted by belecona View Post
The simplest way to check this will be through the use of Print statements to the Output window to ensure no more trades are taken once your goals are met.2. I had Cumlosstarget and Cumprofittarget at $20 and $100 respectively. I expected the strategy would not trigger a second trade or more trades after completion of the first trade. It did not stop at one trade and continued until end trade time. Why?LanceNinjaTrader Customer Service
-
Hello,
I was saying that you could use them to debug your code to print out results each step of the way. This way you could figure out if a specific variable was not being set to true/false when you might have expected it to be.Originally posted by belecona View PostThanks Lance. Was not aware of stoplimit orders until now .. oh well.
Don't understand the relationship between Print Statement and daily goals. Will explore further.
Beth
Debugging your NinjaScript codeLanceNinjaTrader Customer Service
Comment
-
It did what you asked it to do.Originally posted by belecona View PostI'm back with Qs!
Note: I've replaced Stop orders with Limit ones. Ran my strategy on a 60-day 6E 12-12 1-minute chart. Went through the trade log/chart.
1. It has trades that did not reach the breakout point yet limit orders got filled. Per enclosed chart, breakout @1.2758. Price did not reach 1.2758 and got filled. What happened? It's not an isolated incident and happened quite often.
Beth
You said: If the bar low is at or below the range lowestLow, sell short at a price one tick below the lowestLow.
The trade was triggered, and on the next bar, the price was above your asking price (Limit order means that you want to be filled at your price or better). You said that you wanted to sell at 1.2758, and the last price was 2 ticks higher. Depending on the bid/ask spread and the time that your order reached the market, your asking price was probably the bid price or 1 tick lower. As a Limit order should always be filled at Limit price or better, if your asking price was 1 tick below the bid, it will be immediately filled: if at the bid, it will be filled when it reaches the front of the queue.
Comment
-
Comment
-
Hello! I went through the Orders and Trades tabs. Only Short orders .. not sure why Long orders did not get triggered/filled. For the short orders, most entry points were correct except a few strange ones.
I made the following 2 changes to Koganam's revised script:
1. Changed Limit orders to LongStopLimit/ShortStopLimit orders
2. De-activated DrawText so that my chart is cleaner
Nothing else. What had happened?
Beth
Comment
-
Cannot tell offhand, but that looks really wonky. All your entries are at a price of 1.Originally posted by belecona View PostHello! I went through the Orders and Trades tabs. Only Short orders .. not sure why Long orders did not get triggered/filled. For the short orders, most entry points were correct except a few strange ones.
I made the following 2 changes to Koganam's revised script:
1. Changed Limit orders to LongStopLimit/ShortStopLimit orders
2. De-activated DrawText so that my chart is cleaner
Nothing else. What had happened?
Beth
I do not think they are even valid entries. Try repairing your database, and then restart NT. At least, let us be sure that NT is not the one that is in a funny state. I have seen a lot of strangeness with large frameworks that depend in .NET.
Comment
-
Hi Koganam
I did Repair DB (Tools -> Options -> Data -> Repair DB) per your kind suggestion. Logout and signed back in. Ran the enclosed strategy on a 10-day 6E 12-12 1-minute chart (up to 15 Dec when most switched to 03-13 contracts). Same scary performance/orders/trades (only short again).
Will you consider running the enclosed and see if you get the same results?
Thank you!
Beth
Comment
-
Looking at your code, you have a syntax boo boo, where the syntax is valid, but not what you intended.Originally posted by belecona View PostHi Koganam
I did Repair DB (Tools -> Options -> Data -> Repair DB) per your kind suggestion. Logout and signed back in. Ran the enclosed strategy on a 10-day 6E 12-12 1-minute chart (up to 15 Dec when most switched to 03-13 contracts). Same scary performance/orders/trades (only short again).
Will you consider running the enclosed and see if you get the same results?
Thank you!
Beth
Your entry order is:
That is the second overload for the method. That means that while it is correct syntax, you are specifying aCode:EnterLongStopLimit(DefaultQuantity, highestHigh+TickSize,"");
LimitPrice of DefaultQuantity, which is 1 (literally), and a StopPrice of highestHigh+TickSize.
Once again, the code did as you instructed, albeit those fills look funny and could point to a problem with the backtest engine. There was obviously a better fill price than "1" in all cases. Report it as a possible bug, and let us see what NT says.
You are looking for the 4th overload of the method. ref: (int quantity, double limitPrice, double stopPrice, string signalName)
I would suggest that you do as I still do. Before you use a method in any manner that you have not used before, consult the documentation and be sure that you are using the correct overload.
Comment
-
No need to wait for NT. Correct your code to use the correct syntax. Your issue is from using the wrong syntax.Originally posted by belecona View PostThanks Koganam. Will now wait for NT to get back to me before my next move.
Night-night.
Beth
The seemingly funny fills is an entirely different issue. (Which is what I suggested that you report as a possible bug in the backtest engine).
Comment
-
Comment
-
Hello everyone
I'm very grateful for your help and sharing so that my breakout strategy is close to completion.
It's an unexpected lengthy and scary experience. My heart almost cracked into pieces when I saw the million $ loss on a monthly performance. It's a great learning lesson for me. Thanks for your time and guidance!
Happy Holidays! Wishing you and your family a Healthy & Prosperous 2013!
Beth
Comment
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by Geovanny Suaza, 02-11-2026, 06:32 PM
|
0 responses
651 views
0 likes
|
Last Post
|
||
|
Started by Geovanny Suaza, 02-11-2026, 05:51 PM
|
0 responses
370 views
1 like
|
Last Post
|
||
|
Started by Mindset, 02-09-2026, 11:44 AM
|
0 responses
109 views
0 likes
|
Last Post
by Mindset
02-09-2026, 11:44 AM
|
||
|
Started by Geovanny Suaza, 02-02-2026, 12:30 PM
|
0 responses
574 views
1 like
|
Last Post
|
||
|
Started by RFrosty, 01-28-2026, 06:49 PM
|
0 responses
577 views
1 like
|
Last Post
by RFrosty
01-28-2026, 06:49 PM
|


Comment