Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Post market order

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

    Post market order

    Hi, I'm trying to figure out how Ninja could put a buy market order in the spain post market.

    Spain´s post market starts at 17:30 (spain time) and ends 17:35.

    The price traded at post market it's the close price of session.

    For any condition, for example if lastest Close at time 17:29 (just before the post market) cross above SMA(20) enter long and send a market order in the post market.

    Ninja could do that? I'm losting my life traying to get work out, but since Ninja calcs prices with bar close, and during the post market there´s no incoomming ticks sounds impossible (the last tick will be at 17:35 when final price is fixed during the 5 minutes post market ).

    And CalculateOnBarClose = false, the order will be sent anytime when an incomming tick arrives during 17:29 and 17:30 but not at post market.

    Any idea?

    Thanks.

    #2
    Hi fercho,

    You could work with custom events like a timer to submit orders outside of OnBarUpdate(). This sample can help you work with timer objects.


    Keep in mind that if there is no bar update received, the simulator (Sim101 account) can't fill the order.
    Ryan M.NinjaTrader Customer Service

    Comment


      #3
      so, if there's no incomming tick (like the post trade sessions) ninja could however send a market order for example:

      If (ToTime(Time[0]) == ToTime(17, 30, 01))

      EnterLong(1000,"Long");

      just using a time condition?

      or Ninja must receive a tick to understand the current time?

      Thanks

      Comment


        #4
        For the current time, you'd want to use your computer clock instead of the bar time stamp. That's available with DateTime.Now

        If there's no trades, then you'd need to add a custom event that submits orders outside of OnBarUpdate(). You can use the timer object from that reference sample to raise an event every second that checks DateTime.Now for an order condition.
        Ryan M.NinjaTrader Customer Service

        Comment


          #5
          Sorry It's very advanced code for me. Could just paste an example on how to do it?

          It will simplify a lot my learning. Thanks in advance.

          Comment


            #6
            Yes, I understand it can be tricky, but the sample linked is the best way to see a working example of it with all the parts integrated within one script.

            If you have do not have the programming experience required to integrate the sample concepts into your own strategy, you can always consider contacting one of our 3rd party NinjaScript consultants:
            Ryan M.NinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by argusthome, 03-08-2026, 10:06 AM
            0 responses
            68 views
            0 likes
            Last Post argusthome  
            Started by NabilKhattabi, 03-06-2026, 11:18 AM
            0 responses
            41 views
            0 likes
            Last Post NabilKhattabi  
            Started by Deep42, 03-06-2026, 12:28 AM
            0 responses
            24 views
            0 likes
            Last Post Deep42
            by Deep42
             
            Started by TheRealMorford, 03-05-2026, 06:15 PM
            0 responses
            27 views
            0 likes
            Last Post TheRealMorford  
            Started by Mindset, 02-28-2026, 06:16 AM
            0 responses
            54 views
            0 likes
            Last Post Mindset
            by Mindset
             
            Working...
            X