Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Where to start if I want to create a strategy on a trading set-up?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Originally posted by belecona View Post
    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.
    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 order




    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?
    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.
    LanceNinjaTrader Customer Service

    Comment


      Thanks 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

      Comment


        Hello,

        Originally posted by belecona View Post
        Thanks 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
        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.

        Debugging your NinjaScript code
        LanceNinjaTrader Customer Service

        Comment


          Originally posted by belecona View Post
          I'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
          It did what you asked it to do.

          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


            Doing one trade per trading session will be the last piece of puzzle I need to incorporate into my strategy. I did it before (months ago). Need to research and/or locate my "old" notes.

            Thank you Lance and Koganam!

            Beth

            Comment


              I only changed Limit orders to StopLimit orders. Guess what happened when I had the revised strategy on a 60-day 6E 12-12 1-minute chart?! Scary

              Based on the Orders tab, all my Profit Target orders were at 0.9992? Should be 8 ticks from entry. Now I have a big head - gosh!

              Beth
              Attached Files

              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
                Attached Files

                Comment


                  Originally posted by belecona View Post
                  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
                  Cannot tell offhand, but that looks really wonky. All your entries are at a price of 1. 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
                    Attached Files

                    Comment


                      Originally posted by belecona View Post
                      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
                      Looking at your code, you have a syntax boo boo, where the syntax is valid, but not what you intended.

                      Your entry order is:

                      Code:
                      EnterLongStopLimit(DefaultQuantity, highestHigh+TickSize,"");
                      That is the second overload for the method. That means that while it is correct syntax, you are specifying a

                      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.
                      Last edited by koganam; 12-20-2012, 07:25 PM. Reason: Corrected spelling.

                      Comment


                        Thanks Koganam. Will now wait for NT to get back to me before my next move.

                        Night-night.

                        Beth

                        Comment


                          Originally posted by belecona View Post
                          Thanks Koganam. Will now wait for NT to get back to me before my next move.

                          Night-night.

                          Beth
                          No need to wait for NT. Correct your code to use the correct syntax. Your issue is from using the wrong syntax.

                          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


                            Thanks Koganam! I think I have the correct codes now for the StopLimit orders as the trades looked quite normal .. haha ..

                            The finish touch will be to have one trade every trading session. Will sim-run it on live tomorrow. Wish me luck!

                            Night-night.

                            Beth (grateful)
                            Attached Files

                            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


                                Thanks for the well wishes, Beth, and best to you and yours this holiday season!
                                MatthewNinjaTrader Product Management

                                Comment

                                Latest Posts

                                Collapse

                                Topics Statistics Last Post
                                Started by Geovanny Suaza, 02-11-2026, 06:32 PM
                                0 responses
                                649 views
                                0 likes
                                Last Post Geovanny Suaza  
                                Started by Geovanny Suaza, 02-11-2026, 05:51 PM
                                0 responses
                                370 views
                                1 like
                                Last Post Geovanny Suaza  
                                Started by Mindset, 02-09-2026, 11:44 AM
                                0 responses
                                109 views
                                0 likes
                                Last Post Mindset
                                by Mindset
                                 
                                Started by Geovanny Suaza, 02-02-2026, 12:30 PM
                                0 responses
                                574 views
                                1 like
                                Last Post Geovanny Suaza  
                                Started by RFrosty, 01-28-2026, 06:49 PM
                                0 responses
                                576 views
                                1 like
                                Last Post RFrosty
                                by RFrosty
                                 
                                Working...
                                X