Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Show Forex Bid/Ask Spread

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

    Show Forex Bid/Ask Spread

    Hi,
    Is there a way to clearly show the exact bid-ask spread in Forex charts ?
    I have the data set to 1/10 pip increments and can see the exact bid and ask prices,
    but I want an indicator that shows the spread as a figure somewhere on the chart
    so that I can see it with a quick glance and don't have to calculate it mentally.
    I am using the FXCM data feed.
    Thanks.

    #2
    Hello Mikeming,

    Yes, this is possible.

    Are you wanting when there is a trade at the bid or ask like what shows on a chart or are you wanting the updates as is shown in the Chart Trader area?

    If you want when there are trades, add a secondary ask series to the script and this will provide you with all of the ask historical and real-time data for when there are trades at the ask. (The bid will be the primary by default as Forex data does not have a true last price. The last price is actually the bid price)
    http://www.ninjatrader.com/support/h...s/nt7/add3.htm
    Add(Instrument.FullName, BarsPeriod.Id, BarsPeriod.Value, MarketDataType.Ask);

    If you want where there are updates even when there is no trade, then you will want to do this in OnMarketData and capture each ask or bid change.
    http://www.ninjatrader.com/support/h...marketdata.htm
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      How could you create a condition that says the spread must be <= 1 ticks in order to execute an order? Also would this be good for fx futures and stocks?

      I am testing with this... but doesn't seem to be working correctly.

      double Spread = Math.Abs (GetCurrentBid()-GetCurrentAsk());
      {
      Print(Spread.ToString());
      }
      if (Spread <= 1 * TickSize);
      {
      Print("Spread Less Than or Equal to 1");
      }
      if (Spread > 1* TickSize);
      {
      Print("Spread Greater Than 1");
      }
      Last edited by brucelevy; 02-09-2016, 11:28 PM.

      Comment


        #4
        Hi brucelevy,

        Thanks for your post.

        I converted it to ticks and worked with it an as integer:

        int Spread = (int) Instrument.MasterInstrument.Round2TickSize(Math.Ab s (GetCurrentBid()-GetCurrentAsk())/TickSize);

        if (Spread == 1)
        {
        Print ("Spread = 1");
        }
        else if (Spread > 1)
        {
        Print ("Spread = "+Spread);
        }

        Comment

        Latest Posts

        Collapse

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