Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Get Last Price

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

    Get Last Price

    Hello,

    I need to get the last traded price (tick by tick, not close price of the bar).

    I see there is a command for ask and bid, but not the last.

    I would need something like this:

    GetCurrentAsk(), or this: GetCurrentBid(), but for the Last traded price...

    Could you tell me if it is possible to get the last price?

    Thank You

    #2
    Hello,

    Thank you for the question.

    You could do this various different ways but it would depend on how the rest of your logic needs to work. You can utilize CalculateOnBarClose = false and then use Close[0]. Another way is to Add a 1 tick secondary series and utilize the Ticks close price. Also you can use OnMarketData and store the last price as a variable.

    All three of these items would have various effects on how the logic would be formed or how the script would perform. I would suggest to review the help guide on these individual concepts to find the one that works for what you want to do.







    I look forward to being of further assistance.

    Comment


      #3
      It is very strange, but when I get Close[0] and Close[1] and print these, and then I see to the data on chart, there are not the same values. I'm using CL 01-17 instrument, and the chart show price data around 53 s while the Close [0] and Close [1] shows data around 50 s...

      Comment


        #4
        Hello,

        Thank you for the reply.

        Could you tell me what the specifics of the test were?

        What CalculateOnBarClose setting was the script using and also what timeframe was the script applied on? The specifics of the testing will matter on how the script is executed and what prices it can Print. Depending on where you are placing Prints you can affect the values seen as well.

        If you can provide the syntax for the test you were doing along with the settings used we can likely depict better what had occurred.

        I look forward to being of further assistance.

        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
        331 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
        549 views
        1 like
        Last Post Geovanny Suaza  
        Started by RFrosty, 01-28-2026, 06:49 PM
        0 responses
        550 views
        1 like
        Last Post RFrosty
        by RFrosty
         
        Working...
        X