Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

Partner 728x90

Collapse

Programming for Forex markets

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

    Programming for Forex markets

    I am developing a strategy to trade Forex instruments. I am using the FXCM beta connection.

    I understand that the chart only shows the bid price. However, when I place a Buy Limit order, it will only execute at the ask price. The strategy is only seeing the bid price -- so how do I get the strategy to know when to look at the bid and when to look at the ask for limit orders to know when they should get filled? Is there a separate data series for each?

    Is there a way to switch a chart from bid to ask price, like the FXMC Trading Station II charts?

    Thanks!
    Bryan
    cassb
    NinjaTrader Ecosystem Vendor - Logical Forex

    #2
    Hello cassb,

    How are you placing the Buy Limit order?

    You can be able to see the current bid and ask price by using the GetCurrentAsk() and GetCurrentBid(). Alternatively, you can use the OnMarketData() to be able to view the price of the ask and bid price. See the following links for references.

    GetCurrentAsk(): http://www.ninjatrader.com/support/h...currentask.htm

    GetCurrentBid(): http://www.ninjatrader.com/support/h...currentbid.htm

    OnMarketData(): http://www.ninjatrader.com/support/h...marketdata.htm

    There is not an option to change what price type a chart is going to plot unless you use a custom bar type. Creating custom bar types is not supported by NinjaTrader. However, you can review source code for existing bar types and could create your own as well. Note that you will need something like Visual Studio or a text editor to open this file here:
    (My) Documents -> NinjaTrader 7 -> bin -> Custom -> Type -> @BarTypes.cs

    Happy to be of further assistance.
    JCNinjaTrader Customer Service

    Comment


      #3
      Yes, I think I can use the GetCurrentAsk and GetCurrentBid to do what I need. Thanks!
      cassb
      NinjaTrader Ecosystem Vendor - Logical Forex

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by trilliantrader, 04-18-2024, 08:16 AM
      4 responses
      18 views
      0 likes
      Last Post trilliantrader  
      Started by mgco4you, Today, 09:46 PM
      1 response
      7 views
      0 likes
      Last Post NinjaTrader_Manfred  
      Started by wzgy0920, Today, 09:53 PM
      0 responses
      9 views
      0 likes
      Last Post wzgy0920  
      Started by Rapine Heihei, Today, 08:19 PM
      1 response
      10 views
      0 likes
      Last Post NinjaTrader_Manfred  
      Started by Rapine Heihei, Today, 08:25 PM
      0 responses
      10 views
      0 likes
      Last Post Rapine Heihei  
      Working...
      X