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);
        }
        Paul H.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Spiderbird, Today, 12:15 PM
        1 response
        6 views
        0 likes
        Last Post NinjaTrader_ChristopherJ  
        Started by FrazMann, Today, 11:21 AM
        1 response
        6 views
        0 likes
        Last Post FrazMann  
        Started by lorem, Yesterday, 09:18 AM
        5 responses
        18 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Started by cmtjoancolmenero, Yesterday, 03:58 PM
        12 responses
        42 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Started by geddyisodin, Yesterday, 05:20 AM
        8 responses
        52 views
        0 likes
        Last Post NinjaTrader_Gaby  
        Working...
        X