Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Last trasded strategy price

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

    Last trasded strategy price

    Is there some way to use last traded price- i.e. the last price that you traded upon as part of your strategy- part of your strategy?

    For example could you have a function built on bid last traded price-3 ticks?
    I know that you can use {average strategy price} but is there somewhere you can use the last price you traded on?

    Thanks

    #2
    Hello,


    I'm not sure what you want.

    You can use IOrder find out what your avg. fill price was and what your fill price was:


    You can use GetCurrentBid() and GetCurrentAsk():



    Note getting the bid and ask only works in real time, otherwise it returns the close value.
    DenNinjaTrader Customer Service

    Comment


      #3
      Ahh.. actually i would like to quote a price based off the last price that a strategy has executed.

      Can i call a function that tells me the last price that the strategy executed?
      The average function gives the average price for the strategy- what is the equivalent which is the last price the strategy traded on?

      Hope that is clearer?

      Thanks
      Alex

      Comment


        #4
        Hello,


        It depends on what you mean by executed:

        Execution usually means when an order is filled. In this case use the IOrder stuff I posted.

        If you mean the last price the strategy recieved as an incoming tick or new bar, these are bid and ask. In the strategy analyzer however you have access to the Open, High, Low, and Close of the bar.
        DenNinjaTrader Customer Service

        Comment


          #5
          Ben,

          Thanks.. i think i get it.. if i call the IOrder function with the AvgFillPrice that should give me the average fill of the last order.

          what if I want to use the last fill -which would be be the last trade executed as part of an order?

          Comment


            #6
            Hello,

            Then you would assign that IOrder fill price to a variable and then use that variable in your strategy.
            DenNinjaTrader Customer Service

            Comment


              #7
              Thanks Ben... i guess the question I am asking is how do you get that particular order ID? Is there a function call of {get last executed trade price}?

              Thanks again

              Comment


                #8
                You need to just use IOrders. Then you reference the IOrder object for the information you want.
                Josh P.NinjaTrader Customer Service

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by GussJ, 03-04-2020, 03:11 PM
                16 responses
                3,281 views
                0 likes
                Last Post Leafcutter  
                Started by WHICKED, Today, 12:45 PM
                2 responses
                19 views
                0 likes
                Last Post WHICKED
                by WHICKED
                 
                Started by Tim-c, Today, 02:10 PM
                1 response
                9 views
                0 likes
                Last Post NinjaTrader_ChelseaB  
                Started by Taddypole, Today, 02:47 PM
                0 responses
                5 views
                0 likes
                Last Post Taddypole  
                Started by chbruno, 04-24-2024, 04:10 PM
                4 responses
                53 views
                0 likes
                Last Post chbruno
                by chbruno
                 
                Working...
                X