Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

Partner 728x90

Collapse

stop execution of orders and limited bar [0]

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

    #16
    Hello,

    If you add TraceOrders = True in the Initialize Method you will be able to trace the orders to see what is happening.




    Please add this then check under control center->tools->output window and let me know what is being outputted here. You see any errors?

    Comment


      #17
      hello I never thought it was so hard to close a position on the same bus stop input, in other plafaformas is not so complicated, you can control this other code please tell me how I can make a stop output in the entry bar, so it never closed positions, thank you very much.

      double stoploss = Position.AvgPrice - Position.AvgPrice * (filterR/100) ;

      if (CrossAbove(ZeroLagTEMA(Period).ZeroTEMA, ZeroLagHATEMA(Period).ZeroHATEMA, 1)
      && RelativeSlope(period)[0]<filterR

      )

      { SetStopLoss (CalculationMode .Price ,stoploss);

      EnterLong(1, "");


      }
      Last edited by optimuss; 08-11-2011, 02:05 PM.

      Comment


        #18
        Hello optimuss,

        You should define in the strategies Initialize() method. See this page for an example of this:


        Set orders are a convenient way to submit stop loss orders, that are automatically applied on entry execution. They can be based on an offset of entry price when using mode ticks or percent.

        The stop loss order will use the last value "set", and dynamic control is possible using principles in this sample:
        Ryan M.NinjaTrader Customer Service

        Comment


          #19
          Hello please seia you kindly extrategia show some examples of where I can view in stop orders programcion com recognized and limited the entry bar, thanks.

          Comment


            #20
            Hello,

            The language barrier here is not allowing me to assist you in the manner you need as I still do not at root understand your what specifically your trying to do.

            Please try using your native language and typing it into translate.google.com and translating to english.

            Then repost the question and we will see if this is a little better.

            Thanks.

            Comment


              #21
              Hello, sorry and I apologize for that .

              was trying to say in the post above, if they could show me please where I can see some example commands Limted closures and stop at the entry bar, thank you very much.
              Attached Files
              Last edited by optimuss; 08-12-2011, 01:20 PM.

              Comment


                #22
                Hello,

                Is this for backtest or for live?

                Thanks.

                Comment


                  #23
                  Hello, for live .

                  Comment


                    #24
                    Hello,

                    I see. Ok to do this you will want to use BarsSinceEntry().

                    BarsSinceEntry() BarsSinceExit()

                    Comment

                    Latest Posts

                    Collapse

                    Topics Statistics Last Post
                    Started by casabella, Today, 04:12 AM
                    0 responses
                    10 views
                    0 likes
                    Last Post casabella  
                    Started by Ludwik, Today, 03:52 AM
                    0 responses
                    7 views
                    0 likes
                    Last Post Ludwik
                    by Ludwik
                     
                    Started by wuannetraam, Today, 02:40 AM
                    0 responses
                    10 views
                    0 likes
                    Last Post wuannetraam  
                    Started by cyberpete76, 03-27-2023, 12:29 AM
                    7 responses
                    272 views
                    1 like
                    Last Post slightly  
                    Started by renewsaltwater, Today, 01:15 AM
                    0 responses
                    4 views
                    0 likes
                    Last Post renewsaltwater  
                    Working...
                    X