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

    #31
    Hi Ryan

    Thanks for your best wishes. I'm embarrassed to report that it has not triggered a long trade (supposed to with the condition met)!

    Must I have a chart with all the indicators of the strategy or a plain one will do when running a strategy? I have the strategy on a 4-tick MedianRenko chart and not with the indicators.

    Note: It worked in the morning with the never-ending trades triggered!

    Please help again .. sorry .. sigh ..

    Comment


      #32
      You don't need the indicators applied to a chart. You can add
      Code:
      TraceOrders = true;
      to your initiliaze section to help debug. Click tools > output window to see this.

      Also take a look at the link below which covers some general debugging tips you should use:



      One thing may be that you are already in a strategy position from historical data.

      If you only want your strategy to run in real-time you can add the statement below:
      Code:
       
      if (Historical)
         return;
      Not sure if that's what's going on though. Best is debug with TraceOrders and follow some of the guidelines in that post.
      Ryan M.NinjaTrader Customer Service

      Comment


        #33
        Thanks Ryan. I will add the following codes to my script:

        TraceOrders = true;

        if (Historical)
        return;

        Oh, the output window is blank.

        I'm currently reviewing my scripts and may start creating a new batch. You will hear from me "for sure" .. smile ..

        Break time for me as I have a big head!! Continue enjoying your afternoon.

        Comment


          #34
          Hi Ryan

          1 more question please for this afternoon. How can I tell the system NOT to place a trade (even the long or short condition is met) IF say

          Indicator 1 = 0

          Appreciate your directing me to find it out. The No Trade condition will prevent choppy trades.

          Thank you!

          Comment


            #35
            Hi Belecona,

            You add a condition to your entry to check that the indicator is not 0.

            Code:
             
            if (allYourOtherConditions && Indicator[0] != 0)
               doSomething;
            Ryan M.NinjaTrader Customer Service

            Comment


              #36
              Hi Ryan

              Your super-swift response has made me feel like a VIP. Thank you.

              Let me clarify the following:

              1. != stands for not

              I will have 1 more gadget upon your kind confirmation. Thanks for making my life easier!

              Comment


                #37
                Yes, that's correct. != not equal to
                Ryan M.NinjaTrader Customer Service

                Comment


                  #38
                  sos again ..

                  Good morning Ryan

                  1. I want the VertLine crossing the Zero line for Exit. Do I have it right?

                  // Exit with warning signals of trend reversal


                  if (CrossBelow(d9ParticleOscillatorWVertLineR(7, 0).RawTrend, 0, 1)

                  ExitLong();

                  2. I tried !> (thought it may mean not greater than) and got an error message.

                  I must have done something wrong .. sigh .. Please help me! Thank you.
                  Last edited by belecona; 03-04-2010, 08:23 PM.

                  Comment


                    #39
                    Hi Belecona,

                    1) Will exitlong once ...vertlineR.RawTrend crosses below 0

                    2. This is not correct usage of not greater than. Operator for this is < or "less than"

                    All C# operators below:
                    Ryan M.NinjaTrader Customer Service

                    Comment


                      #40
                      Thanks Ryan.

                      My petite head was too "stuffed" last night when I tried !>. Sorry! After playing with strategies for just a week, I now understand why most of my programming peers have "silver" hair at a young age.

                      Another question please - Are the following the same? If yes, which one is more effective in your opinion?

                      1. Rising(Indicator1)
                      2. Indicator1[0]>Indicator1[1]

                      Big Big Thank You!

                      Comment


                        #41
                        Yes, these should be the same. Rising is just an easier way of expressing this.
                        Ryan M.NinjaTrader Customer Service

                        Comment


                          #42
                          Thanks Ryan! Bingo for me .. haha ..

                          You maybe glad to learn that I've enough materials to play with this afternoon + weekend. Will pick your brains again next week.

                          Thank You .. Thank You again from the bottom of my petite heart for your prompt guidance and support! Have a Relaxing weekend.

                          Comment


                            #43
                            Thanks for the well-wishes! May you have a productive weekend with NinjaScript.
                            Ryan M.NinjaTrader Customer Service

                            Comment


                              #44
                              Hi Ryan

                              I stand a better chance of having a productive weekend if you don't mind answering one more question for me please, ie

                              I've been trying to adapt a sample strategy with trail stop and cancel orders etc (all the goodies that I would like to have) to mine. I only replaced its entry and exit conditions. F5 has been giving me Successful Compile messages. Yet when I backtested the strategy (almost 10 times with changes here and there - tried to make it work), it has been generating 0 trade forever.

                              I'm thinking maybe the strategy will work on live data and just not backtesting. What do you think?

                              Appreciate your guidance again (as always). Thank you.

                              Comment


                                #45
                                Hello Belecona,

                                One of my suggestions earlier was to run your code on only live data. This was accomplished with the statement:

                                Code:
                                 
                                if (Historical)
                                  return;

                                If you don't have this statement and it's not trading in a backtest, can you reply with the code you're using.
                                Ryan M.NinjaTrader Customer Service

                                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