NinjaTrader Support Forum  

Go Back   NinjaTrader Support Forum > NinjaScript Development Support > Strategy Development

Strategy Development Support for the development of custom automated trading strategies using NinjaScript.

Reply
 
Thread Tools Display Modes
Old 05-22-2007, 09:07 PM   #1
kgillis23
Member
 
Join Date: May 2007
Location: West Jordan, Utah
Posts: 61
Thanks: 0
Thanked 0 times in 0 posts
Default Bid/Ask spread in FOREX

Let me try this again....

I'm new to NT and this forum so I hope this his the right place to ask this question.

In developing and backtesting strategies using Ninjascript I find that my 'EnterLong()' and 'EnterShort()' calls are placing orders at the CurrentAsk and CurrentBid price - which happens to be the same. Does NT take into account the currancy pair pip spread? and if so, how do I set it?

Or do I have to program the spread in my strategy? And if so, how do I do that - for both long and shorts?
kgillis23 is offline  
Reply With Quote
Old 05-23-2007, 07:07 AM   #2
NinjaTrader_Ray
Administrator
 
NinjaTrader_Ray's Avatar
 
Join Date: Nov 2004
Location: Denver, CO, USA
Posts: 11,163
Thanks: 6
Thanked 45 times in 32 posts
Default

There is no concept of bid or ask price in a backtest. In a backtest, we only have a bar OHLCV information. During a backtest, bid and ask price are subsituted with the bar's closing price.

If you want to take into account a spread, I would set my slippage amount when running a backtest to a value of 3 if the currency being tested has a spread of 3.
NinjaTrader_Ray is offline  
Reply With Quote
Old 05-23-2007, 11:38 AM   #3
kgillis23
Member
 
Join Date: May 2007
Location: West Jordan, Utah
Posts: 61
Thanks: 0
Thanked 0 times in 0 posts
Default

So that was easy enough to do... once I knew what I was doing

However, the Slippage only goes as high/low as the bar high/low - meaning that I lose a pip spread here and there.

It dawned on me that I could just determine my trading "cost" by not setting slippage to 0 and then just multipling the pip spread by the number of trades in a backtest.

See any problems with that?
kgillis23 is offline  
Reply With Quote
Old 05-23-2007, 11:42 AM   #4
NinjaTrader_Ray
Administrator
 
NinjaTrader_Ray's Avatar
 
Join Date: Nov 2004
Location: Denver, CO, USA
Posts: 11,163
Thanks: 6
Thanked 45 times in 32 posts
Default

No, I do not see any problem with that.
NinjaTrader_Ray 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
Does this work with any UK Financial Spread Betting firms? vlc Connecting 9 09-19-2012 08:08 AM
Bid/Ask spread indicator updating even if no trades take place RedDuke General Programming 10 05-12-2008 03:29 PM
Futures spread trading flyingeagle Miscellaneous Support 1 11-21-2006 08:57 AM
Forex from MBT Eagle Miscellaneous Support 2 07-17-2006 02:37 AM
forex denalii Miscellaneous Support 3 05-18-2005 01:07 AM


All times are GMT -6. The time now is 05:39 PM.