Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

contruction of his own shooting star

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

    #16
    Open[0] is the price of the current bar. You cannot set a price on the next bar because you do not know what the next bar will be. Only when that next bar has been started will you know the price and then you can submit at Open[0] for that bar.

    Be sure you are using CalculateOnBarClose = false when in real-time.
    Josh P.NinjaTrader Customer Service

    Comment


      #17
      oki a sell limit order for example close of the bar[0]

      but i put a stop order and it is ignored... i made it exactly like on the guide...
      wacth my script : what's wrong ?
      {
      EnterShortLimit(
      1, Close[0], "");
      stopPrice = (High[
      0]+3*TickSize);
      }
      //Exits position
      ExitShortStop(stopPrice);
      }

      Comment


        #18
        You can only place a stop order when you have an active short position. While you do EnterShortLimit(), you do not necessarily have an open stop position yet.
        Josh P.NinjaTrader Customer Service

        Comment


          #19
          to be honest the guide is not really clear... I try to devellop a really simply script :
          i defined my shooting star, if there is a shooting star you sell limit at close of the shooting star, you put a stop 3 tick above the shooting star and you take profit at a risk reward of 2 (entry level - (stop-entry level)*2)... really simply indeed... here my script develop with the guide... what's wrong on my script ?

          Comment


            #20
            followed by :

            if (MyShooting)
            {
            HS=High[
            0];
            {
            BackColor = Color.Pink;
            EnterShortLimit(
            1, Close[0], "");
            }
            }
            else
            {
            //the stop is 3 ticks above my shooting star
            stopPrice = (HS + 3*TickSize);
            if (ExitShortStop(stopPrice));
            {
            EntryLevel=EnterShortLimit;
            //exit position at a risk reward of 2
            ExitShortLimit(EntryLevel-(stopPrice-Entry)*2);
            }
            }
            }

            Comment


              #21
              Thomas79,

              if (ExitShortStop(stopPrice));
              {
              EntryLevel=EnterShortLimit;
              //exit position at a risk reward of 2
              ExitShortLimit(EntryLevel-(stopPrice-Entry)*2);
              }

              That part does not make sense. ExitShortStop() is not something you would run an if-statement on. It places orders.

              When you use limit/stop orders you need to keep them alive. Please read this article: http://www.ninjatrader-support.com/H...tml?Overview36
              Josh P.NinjaTrader Customer Service

              Comment


                #22
                oki i read the article... the best this for me is to set a stop loss and a set profit target... it is write that it is better to write the script in Initialize... this is what i did and it doesn't work :

                protectedoverridevoid Initialize()
                {
                CalculateOnBarClose =
                true;
                //Submits a stop loss 3 ticks above my shooting define bool MyShooting
                SetStopLoss(High[0] + 3* TickSize);
                }

                we are ok than the 'High[0] is the top of the bar where i have my signal... so my shooting star ?

                Comment


                  #23
                  You can't use High[0] in Initialize(). You cannot dynamically modify stop/target prices in Initialize(). You need to hard set a certain stop value whether that be a number of ticks or a percentage or a certain value if you want to do it in Initialize().
                  Josh P.NinjaTrader Customer Service

                  Comment


                    #24
                    Do it in OnBarUpdate(). When you have determined your shooting star, call SetStopLoss() and then place your order. Remember that if you do not change your SetStopLoss() for before the next order, it will take on the same value you set prior.
                    Josh P.NinjaTrader Customer Service

                    Comment

                    Latest Posts

                    Collapse

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