Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

ATM in ninja script strategy

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

    #16
    Hello Bertran will you please help me in this situation:

    I have an first short order at 10000 and then if it reaches 10015 and there is a trigger for the second short order but the first short order has not been filled. Can I take the second short order? If it is possible then give me some tips or reference sample on how to do the second short order. What method will be I am going to used?

    Comment


      #17
      Is this equal? For example my ATM strategy template in the SuperDom is CL Scalp then I declared it as private string template="CL_Scalp". I put an underscore as a replacement for the space in CL Scalp. Is it equal or I will have it to private string template= "CL Scalp"?

      Comment


        #18
        You will have to use the same name as shown in the SuperDOM, if you used a space there, please also make your string input to use a space instead of an underscore.

        You could cancel the pending entry and then submit for your new, amended qty you want to enter with.

        Comment


          #19
          Bertran will you please help me on this. I have a time filter and I tried my strategy that will call ATM strategy and then my problem is that my entry condtion is hit at 9:45 and it is greather than my startTime which is 9:30 suppose to be it will entry an order but It will not entry. I tried it in a market replay. I tried it with a tick type and CalculateOnBarClose is set to false.
          Last edited by luxurious_04; 09-14-2010, 02:09 AM.

          Comment


            #20
            Are there any errors in the log tab as this happens? Have you added Prints and example a visual check like a Dot to see if you're entry condition as coded in really triggers?

            Comment


              #21
              I will do that now thanks for that idea. One more thing is that it will entry an order at 10 am until 4 pm. I just wandering if why does it will entry an order at the first bar of the market replay.

              Comment


                #22
                What MinBarsRequired setting are you using as you start up the strategy in Market Replay?

                Comment


                  #23
                  Originally posted by NinjaTrader_Bertrand View Post
                  What MinBarsRequired setting are you using as you start up the strategy in Market Replay?
                  I didn't used MinBarsRequired setting. The YM chart i used is 10 mins. It will now trade at the 9:30 when the entry condition is hit. I used the ToTime(Time[0]) but in the next day it will not trade again at my starting time when my condition is hit and it will trade at 1:30 pm in that day but it is opposite to my entry condition and more thing, my order.action is buy and it will buy but if the order gets cancelled it entry an order that is sell. I am so confused. Please help me.

                  Comment


                    #24
                    luxurious_04, you should simplify your strategy and work for a start one side of the market only and ensure this works to your expectations before proceeding to get more complex - a good approach would also be printing out the associated values and order / strategy Id's to you can check they are set / reset as needed to take the next trade then.

                    The MinBarsRequired is set as you start up the strategy, it determines how many bars are skipped at the OnBarUpdate() start to give for example indicators needed time to catch up with their values to produce reasonable values for your data.

                    Comment


                      #25
                      I use the default MinBarsRequired which is 20. Why does it will not reset properly I just follow the sample in ninja.

                      Comment


                        #26
                        Bertran thank you. Please give hint on this problem: If RSI is below or equal to 20 then I will look for the lowest low of the next value of RSI on the next bar.

                        current bar:

                        if RSI <=20

                        next 2/3 bars:

                        RSI is below or equal to 20 again then I will get which of that bars has the lowest low of RSI then my entry price will base on the low price of that bar.

                        Any idea would be appreciated. Thanks in advance.

                        Comment


                          #27
                          You would need to track the lowest price since the condition in a variable, save the low value once the conditon triggers and then check the low price agains the saved value on each bar, if it's lower update the variable, if not continue using the previously saved value.

                          Comment


                            #28
                            Ah okay I will need to track the lowest price of the bar. How about this I will also need to track the lowest value of the RSI, for example:

                            RSI.Avg[0] <=20
                            if in the next two bars RSI is still below or equal to 20 then I will select which of RSI has the lowest value.

                            Comment


                              #29
                              Yes, you can use the same approach for tracking other values like your RSI Average as well.

                              Comment


                                #30
                                if (RSI(RSIperiod, RSIsmooth).Avg[0] <= 20)
                                {
                                double RsiLowValue= RSI(RSIperiod, RSIsmooth).Avg[0];
                                }

                                Then now how I am going to differentiate the RsiLowValue to the value of RSI in the next two bars?

                                Comment

                                Latest Posts

                                Collapse

                                Topics Statistics Last Post
                                Started by Geovanny Suaza, 02-11-2026, 06:32 PM
                                0 responses
                                656 views
                                0 likes
                                Last Post Geovanny Suaza  
                                Started by Geovanny Suaza, 02-11-2026, 05:51 PM
                                0 responses
                                371 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
                                579 views
                                1 like
                                Last Post RFrosty
                                by RFrosty
                                 
                                Working...
                                X