Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Printing Spread

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

    Printing Spread

    I tried the following code:

    Code:
    double Spread = GetCurrentAsk() - GetCurrentBid();
    Print("Spread: " + Spread);
    And it printed a bunch of zeroes. Why no values? (Using the gain demo connection, there should be a 0.0003 spread on the EUR/USD.)

    Thank you,
    - Daniel B.

    Edit: I see that it started printing values after letting it run a bit in real-time. Is there any way for me to calculate the spread in past data? I suppose past data is simply where the transactions took place at, not the Bid/Ask prices available at that time, so this is unlikely.
    Last edited by DanielB; 12-29-2009, 01:12 AM.

    #2
    Hi daniel,

    This depends on the version of NT you're using...

    In NT6.5 the Ask price is not stored for historical calculation.
    IN NT7.0 it is.
    mrlogik
    NinjaTrader Ecosystem Vendor - Purelogik Trading

    Comment


      #3
      Thanks... so I'll look forward to 7.

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by Hwop38, 05-04-2026, 07:02 PM
      0 responses
      164 views
      0 likes
      Last Post Hwop38
      by Hwop38
       
      Started by CaptainJack, 04-24-2026, 11:07 PM
      0 responses
      317 views
      0 likes
      Last Post CaptainJack  
      Started by Mindset, 04-21-2026, 06:46 AM
      0 responses
      245 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Started by M4ndoo, 04-20-2026, 05:21 PM
      0 responses
      350 views
      0 likes
      Last Post M4ndoo
      by M4ndoo
       
      Started by M4ndoo, 04-19-2026, 05:54 PM
      0 responses
      179 views
      0 likes
      Last Post M4ndoo
      by M4ndoo
       
      Working...
      X