Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Spec Time close Exit possition

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

    Spec Time close Exit possition

    Hi ,
    Can anybody help me with this situation , please ?

    What I cant figure out is Exit Short Stop at 21:14:59 on day close.
    I don't know a code for it.

    Do know anybody answer ?
    Thanks a lot!

    JakeSnake
    Last edited by Jakub; 06-18-2012, 01:38 PM.

    #2
    Hello JakeSnake,
    Welcome to the forum and I am happy to assist you.

    To assist you further may I know, are you already in a position or in what context you are are trying to submit an exit stop order.

    I look forward to assisting you further.
    JoydeepNinjaTrader Customer Service

    Comment


      #3
      Hi Joy ,
      I trying create new strategy . This strategy have spec time for a entry short position (21:15-21:30) From this time if condition is true , I have (for Short trade)EntryShortStop in specific price level. From this entry short stop I would like make a ExitShortStop on end of the day (today 18/6/2012 at 21:15). I don't know where and what is a context for this exit condition. For example ; I now in short trade YM (e-mini dow jones) entry 12,778 (today opening price) and I would like a exit trade on today close.
      Profit targets and stop loss are already set.

      Thanks
      Last edited by Jakub; 06-18-2012, 07:13 AM.

      Comment


        #4
        Hello Jakum,
        Depending on the session template you are using (and your timezone etc) you can simply set the ExitOnClose property to true.


        If you want to reference it to the timestamp then it would depend on what chart periodicity and timeframe you are using.

        Alternatively you can simply check the Market Position before submitting the entry order. Like,

        Code:
        if (Position.MarketPosition != MarketPosition.Flat)
        {
            //exit long trade
        }
        else
        {
            //enter new trade
        }
        JoydeepNinjaTrader Customer Service

        Comment


          #5
          Hi ,

          Maybe I do something wrong , but this formula doesn't work . Where I have to input these commands ?
          In script this doesn't work.

          Please find attachment and there is screenshot with explain what I mean.

          thanks
          Last edited by Jakub; 06-18-2012, 11:52 AM.

          Comment


            #6
            Hello Jakub,
            You are backtesting it on Daily charts. The time filters wont work in daily charts.

            Also you need to be in a position for an exit. Are you in a position? From the screenshot it appears that you are not.

            I look forward to assisting you further.
            JoydeepNinjaTrader Customer Service

            Comment


              #7
              I am had a profit targets but I am cancelled theme. I will try explain this strategy. In screen shot no.1 you can see what I try to do in 1 min chart. If market open with gap , my entry point is [1] bar ago on high price level for short position. What I looking for is entry on this price level and exit at same day. I am tried all possible function for a short trade and I have still same results. Its doesn't work , how should be. This strategy I am had in Sierra Chart software with "price if touch" . When price come back to high level [1] there was entry point for short position and exit on day close.
              Its very hard set up it in NT , bcs I using this software first month. I just tried lot of different ways , but unsuccessful.

              Can u help me with this ,please ?

              jakesnake
              Last edited by Jakub; 06-18-2012, 11:52 AM.

              Comment


                #8
                Hello Jakub,
                A basic sample code will look like,
                Code:
                if (Bars.FirstBarOfSession)
                {
                	if (conditions for gap)
                	{
                		EnterShortStop(0, true, 1, High[1], "Sell stop");
                	}
                }


                Please note I have used the below overload to submit the stop order. This to make sure that the order is not cancelled if it is not filled on the same bar on which it was submitted.
                EnterShortStop(int barsInProgressIndex, bool liveUntilCancelled, int quantity, double stopPrice, string signalName)


                Please set ExitOnClose to true to exit at the end of the day.

                Please let me know if I can assist you any further.
                JoydeepNinjaTrader Customer Service

                Comment


                  #9
                  Yes!!! works perfectly !!I would like give u kiss for this I am spend this week on this damm code u best
                  THANKS for best customer service!!

                  Comment


                    #10
                    Hello Jakub,
                    Thanks for your note.

                    Please let me know if I can assists you any further.
                    JoydeepNinjaTrader Customer Service

                    Comment

                    Latest Posts

                    Collapse

                    Topics Statistics Last Post
                    Started by Waxavi, Today, 02:10 AM
                    1 response
                    16 views
                    0 likes
                    Last Post NinjaTrader_LuisH  
                    Started by Kaledus, Today, 01:29 PM
                    5 responses
                    13 views
                    0 likes
                    Last Post NinjaTrader_Jesse  
                    Started by Waxavi, Today, 02:00 AM
                    1 response
                    12 views
                    0 likes
                    Last Post NinjaTrader_LuisH  
                    Started by alifarahani, Today, 09:40 AM
                    5 responses
                    23 views
                    0 likes
                    Last Post NinjaTrader_Jesse  
                    Started by gentlebenthebear, Today, 01:30 AM
                    3 responses
                    17 views
                    0 likes
                    Last Post NinjaTrader_Jesse  
                    Working...
                    X