Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Help me with a order

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

    Help me with a order

    Hello my name is Salvador, I´m a Ninja Trader´s new user. I have a problem executing this order:

    If (ToTime(Time(0)) == ToTime(14,30,00))
    {Enter LongLimit(DefaultQuantity,Close[0]+0.0010,"");}


    I want call an order of buying 10 picks above the closed bar at an especific hour and I only achieved to buy between 1 to 3 picks above the closed bar. How could I call the order?

    And some time buy in the same 14,30,00 bar.

    Thank you.

    #2
    Hello,

    Thank you for your first forum post.

    I will have a member of our support team respond in the morning.

    Thank you for your patience.

    Comment


      #3
      firecan, you place a long limit entry order above the market, which would fill instantly (it's marketable) - please try placing a Stop limit order instead for your case.
      BertrandNinjaTrader Customer Service

      Comment


        #4
        Help me with a order

        Hello again, I´ve tried "Enter Long Stop" and ran ok.

        Once the order is called and visualized in the chart. If the price does not reach the order, the order is cancelled one minute later,

        Hope you can find out how to solve it.

        Waiting your reply.

        Regards.

        Salvador Hernandez
        Sevilla

        Comment


          #5
          firecan, please resubmit the order on the next bar or use the overload that offers you to set the 'liveUntilCancelled' parameter, per default orders expire at the end of bar in NinjaTrader.
          BertrandNinjaTrader Customer Service

          Comment


            #6
            Help me with a order

            Hello, thank you for your help. I tried to set the liveUntilCancelled parameter but it was not sucsesful. I solve the problem by the moment using 15 minutes bars.
            I noticed by reading your post that you live in Hamburg. I should have been in Germany yesterday because it was the rottweiller klubsieger show due to the fact that I´m a rottweiller breader.
            By the way, is it possible to send an autobreakeven order at the strategy, I can´t find it out.
            Waiting for your reply. Regards.

            Comment


              #7
              Nice Salvador, I bet that's a challenging profession, too...if you run into order placement issue and wish to debug those in your strategy, the TraceOrders feature we have is very helpful - http://www.ninjatrader.com/support/f...ead.php?t=3627

              For realtime use, you could call ATM templates to manage exits where a autoBreakeven is setup or use this sample code structure to move the stop as you're into profit -

              BertrandNinjaTrader Customer Service

              Comment


                #8
                Help me with a order

                Hola , de nuevo mi amigo. Lo rottweiler es sólo un hobby , yo soy un bombero.

                He resuelto el problema con el punto de equilibrio. Me gustaría saber qué estoy haciendo mal con esta orden :


                / / Condición 1 juego
                si ( ToTime ( Tiempo [ 0] ) == ToTime (14 , 30, 00) )
                { EnterLongStop ( DefaultQuantity , Primer plano [0 ] + 0,0005, " ") ; }
                { EnterShortStop ( DefaultQuantity , Cerrar [ 0] - 0,0005, " ") ; }


                Se envía la orden de largo por primera vez en el momento adecuado y funciona cuando el precio alcanza . Pero el orden de corto segunda sólo se envía cuando el primero está cerrado.

                Lo que realmente quiero es enviar dos pedidos al mismo tiempo, y quiero que al trabajo cuando el precio llega a ellos , los dos de ellos si es necesario.

                No estoy buscando para llamar a una orden OCO.

                Esperando su respuesta, saludos.

                Comment


                  #9
                  Originally posted by firecan View Post
                  Hola , de nuevo mi amigo. Lo rottweiler es sólo un hobby , yo soy un bombero.

                  He resuelto el problema con el punto de equilibrio. Me gustaría saber qué estoy haciendo mal con esta orden :


                  / / Condición 1 juego
                  si ( ToTime ( Tiempo [ 0] ) == ToTime (14 , 30, 00) )
                  { EnterLongStop ( DefaultQuantity , Primer plano [0 ] + 0,0005, " ") ; }
                  { EnterShortStop ( DefaultQuantity , Cerrar [ 0] - 0,0005, " ") ; }


                  Se envía la orden de largo por primera vez en el momento adecuado y funciona cuando el precio alcanza . Pero el orden de corto segunda sólo se envía cuando el primero está cerrado.

                  Lo que realmente quiero es enviar dos pedidos al mismo tiempo, y quiero que al trabajo cuando el precio llega a ellos , los dos de ellos si es necesario.

                  No estoy buscando para llamar a una orden OCO.

                  Esperando su respuesta, saludos.


                  Firecan,

                  Please write up your posts in English as this forum is English only. We don't address any issues in Spanish or other languages than English.
                  Vince B.NinjaTrader Customer Service

                  Comment


                    #10
                    Help with a order

                    Hello my friend.

                    The Rottweiller thing is just a hobby, I'm a fireman.

                    I solved the problem with the breakeven.

                    I'd like to know what am I doing wrong with this order:

                    if (ToTime(Time[0]) == ToTime(14, 30, 00))
                    { EnterLongStop(DefaultQuantity, Close[0] + 0.0005, ""); }
                    { EnterShortStop(DefaultQuantity, Close[0] - 0.0005, ""); }

                    The first long order is sent at the right time and it works when the price reaches it. But the second one is sent only when the first order is closed.

                    What I really want is to send both orders at the same time, and I want them to work when the price reaches them, the two of them if it's necessary.

                    I'm not looking to call an OCO order

                    Waiting for your reply, regards.

                    Comment


                      #11
                      Thanks for the translation Sevilla, if you're enabling TraceOrders in your strategy you would see ignored orders in your output window while debugging it, this is because you're running into the internal order handling rules with the approach (on NT7 you could use the unmanaged order submission mode not 'guarded' by these rules) -



                      Interal Order Handling Rules that Reduce Unwanted Positions
                      NinjaTrader is a real-time live trading platform and thus we need to ensure that we prevent situations in real-time where you may have multiple orders working accomplishing the same task. An example of this would be if your strategy had a target limit order for 1 contract working and then your strategy issued a market order to close the position. This is dangerous since it could result in both orders getting filled and instead of having a flat position you are now short! To prevent these types of situations, there are some "under the hood" rules that a NinjaScript strategy follows when order methods are called.
                      For the most part, you do not need to be intimately familiar with these rules as you develop your strategies, its all taken care of for you internal within a strategy. If a rule is violated, you will be notified through an error log in the Control Center log tab when running a strategy in real-time or in a backtest.
                      The following rules are true per unique signal name excluding market orders:




                      Methods that generate orders (excluding market orders) to enter a position will be ignored if:
                      • A position is open and an order submitted by an exit method (ExitLongLimit() for example) is active and the order is used to open a position in the opposite direction
                      • A position is open and an order submitted by a set method (SetStopLoss() for example) is active and the order is used to open a position in the opposite direction
                      • The strategy position is flat and an order submitted by an enter method (EnterLongLimit() for example) is active and the order is used to open a position in the opposite direction


                      Methods that generate orders to exit a position will be ignored if a strategy position is open and:
                      • An order submitted by an enter method (EnterLongLimit() for example) is active and this entry order is used to open a position in the opposite direction
                      • An order submitted by a set method (SetStopLoss() for example) is active


                      Set() methods that generate orders to exit a position will be ignored if a strategy position is open and:
                      • An order submitted by an enter method (EnterLongLimit() for example) is active and this entry order is used to open a position in the opposite direction
                      • An order submitted by an exit method (ExitLongLimit() for example) is active
                      BertrandNinjaTrader Customer Service

                      Comment


                        #12
                        Help me with a order

                        Hello again.

                        I have this order:

                        // Once the price is greater than entry price+10 ticks, set stop loss to breakeven

                        if (Close[0] >= Position.AvgPrice +10 * TickSize)
                        { SetStopLoss(CalculationMode.Price, Position.AvgPrice); }

                        first I´d like to know why do not work.

                        And then I´d like to kown how send the stop loss to breakeven when the price arrive to entry +15 ticks, without wait closes a bar.

                        Thank you.

                        Comment


                          #13
                          firecan, is there an error shown in the output window from TraceOrders?

                          To send in a stop at breakeven without waiting for the bar to close would require you to run only certain logic every tick, and then your main strategy code on every closed bar. There is a reference sample that goes over how to do that. You can also take a look at the reference sample that goes over how to modify your stop loss/profit target prices.
                          AustinNinjaTrader Customer Service

                          Comment


                            #14
                            help with a order

                            Hello again.
                            I have this order that is executed at the exact hour.

                            if (ToTime(Time[0]) == ToTime(15,45,00))
                            { EnterLongStop(DefaultQuantity,Close[0]+0.000005, ""); }

                            But when I change the hour of entry it stops working, I do not why.

                            How to do that the order of the hour of entry into the zone of variables and her it could change this one there.


                            #region Variables
                            privateint stoplossticks = 20;
                            privateint profittargetticks = 100;

                            Here time of entry

                            #endregion

                            Thank you.

                            Comment


                              #15
                              What kind of chart / timeframe are you running this on? Does it have a bar timestamp at this time, allowing your time condition to evaluate to true and trigger the trade?

                              You can for example setup a user defined integer input for entering the time -

                              BertrandNinjaTrader Customer Service

                              Comment

                              Latest Posts

                              Collapse

                              Topics Statistics Last Post
                              Started by Perr0Grande, Today, 08:16 PM
                              0 responses
                              2 views
                              0 likes
                              Last Post Perr0Grande  
                              Started by elderan, Today, 08:03 PM
                              0 responses
                              5 views
                              0 likes
                              Last Post elderan
                              by elderan
                               
                              Started by algospoke, Today, 06:40 PM
                              0 responses
                              10 views
                              0 likes
                              Last Post algospoke  
                              Started by maybeimnotrader, Today, 05:46 PM
                              0 responses
                              12 views
                              0 likes
                              Last Post maybeimnotrader  
                              Started by quantismo, Today, 05:13 PM
                              0 responses
                              7 views
                              0 likes
                              Last Post quantismo  
                              Working...
                              X