NinjaTrader Support Forum  
X

Attention!

This website will be down for maintenance from Friday May 24th at 6PM MDT until Saturday May 25th at 11AM MDT. We apologize for the inconvenience. If you need assistance during this time, please email sales@ninjatrader.com


Go Back   NinjaTrader Support Forum > NinjaScript Development Support > General Programming

General Programming General NinjaScript programming questions.

Reply
 
Thread Tools Display Modes
Old 08-23-2012, 09:47 AM   #1
cassb
Senior Member
 
Join Date: Nov 2007
Location: Victor, NY
Posts: 577
Thanks: 5
Thanked 4 times in 4 posts
Send a message via Yahoo to cassb Send a message via Skype™ to cassb
Default 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
Price-Dynamics.com
A NinjaTrader Official Partner

Visit http://www.price-dynamics.com to learn more about the Rhythm Relay trading system. Yes, you can discretionary or auto-trade with 75%+ accuracy!

Use our Contact Us page to request free access to our daily Trader's Lounge where you can see the system in action in a live account!
cassb is offline  
Reply With Quote
Old 08-23-2012, 10:40 AM   #2
NinjaTrader_JC
NinjaTrader Customer Service
 
NinjaTrader_JC's Avatar
 
Join Date: Mar 2012
Location: Denver, CO
Posts: 1,200
Thanks: 137
Thanked 183 times in 182 posts
Default

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.
NinjaTrader_JC is offline  
Reply With Quote
Old 08-23-2012, 12:19 PM   #3
cassb
Senior Member
 
Join Date: Nov 2007
Location: Victor, NY
Posts: 577
Thanks: 5
Thanked 4 times in 4 posts
Send a message via Yahoo to cassb Send a message via Skype™ to cassb
Default

Yes, I think I can use the GetCurrentAsk and GetCurrentBid to do what I need. Thanks!
Price-Dynamics.com
A NinjaTrader Official Partner

Visit http://www.price-dynamics.com to learn more about the Rhythm Relay trading system. Yes, you can discretionary or auto-trade with 75%+ accuracy!

Use our Contact Us page to request free access to our daily Trader's Lounge where you can see the system in action in a live account!
cassb is offline  
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
cant get data on mini markets salhansen Version 7 Beta General Questions & Bug Reports 1 11-13-2009 09:44 AM
Foreign Markets rtj4201 Charting 2 01-13-2009 12:24 PM
other markets Bypass98 Connecting 2 01-08-2009 05:52 AM
Two Way Markets supported? altrader Connecting 1 03-10-2008 09:59 AM
NT5 In Fast Markets al_gorithm Miscellaneous Support 4 12-05-2005 02:10 PM


All times are GMT -6. The time now is 02:30 AM.