NexusFi: Find Your Edge


Home Menu

 





Backtesting and bid-ask spread


Discussion in NinjaTrader

Updated
    1. trending_up 2,729 views
    2. thumb_up 0 thanks given
    3. group 1 followers
    1. forum 2 posts
    2. attach_file 0 attachments




 
 

Backtesting and bid-ask spread

 
Tricks
Neaples Italy
 
Posts: 2 since Mar 2015
Thanks Given: 0
Thanks Received: 0

Hi.
I use NT7 with imported 1 min forex data, that Ninjatrader handles by considering only bid prices.

I saw there is no way to include bid-ask spreads into backtesting, so my workaround is that of setting a commission, then backtesting with "Include commissions" set to true, and simulating trades with a fixed lot size, proportional to commission.

Example:
- I want to backtest on EURUSD, assiming a bid-ask spread o 1 pip.
- On Instument Manager I set Minimum Commission = 0.5 (because it's per side).
- I backtest assuming single trades with 10000 units, so that I pay 1 pip = 1$ per trade and the spread is equalized the commission.

This is all good and working if I want to test the pure signal, or if I'm using a fixed lot type position sizing.

But, let's assume that the lot size traded depends on an ATR stop so that the lot size is variable every time.
In this case I would pay a 1$ spread for every trade, regardless from lot size, and the equity line would be wrong.
This means that I can backtest this kind of strategy only without commission.

Any way to work around the problem?
Would I have this problem were I using Kinetick?
What's another backtasting platform that would not have this inconvenience?
(I'm testing Seer Trading, but it has bugs loading historical data)

Thank you.


Can you help answer these questions
from other members on NexusFi?
Pivot Indicator like the old SwingTemp by Big Mike
NinjaTrader
Cheap historycal L1 data for stocks
Stocks and ETFs
What broker to use for trading palladium futures
Commodities
NT7 Indicator Script Troubleshooting - Camarilla Pivots
NinjaTrader
Trade idea based off three indicators.
Traders Hideout
 
 
 
Big Mike's Avatar
 Big Mike 
Manta, Ecuador
Site Administrator
Developer
Swing Trader
 
Experience: Advanced
Platform: Custom solution
Broker: IBKR
Trading: Stocks & Futures
Frequency: Every few days
Duration: Weeks
Posts: 50,471 since Jun 2009
Thanks Given: 33,250
Thanks Received: 101,674

You can do it with GomRecorder and also I think Gom Tookit for Strategies





Mike



Join the free Markets Chat beta: one platform, all the trade rooms!

We're here to help: just ask the community or contact our Help Desk

Quick Links: Change your Username or Register as a Vendor
Searching for trading reviews? Review this list
Lifetime Elite Membership: Sign-up for only $149 USD
Exclusive money saving offers from our Site Sponsors: Browse Offers
Report problems with the site: Using the NexusFi changelog thread
Follow me on Twitter Visit my NexusFi Trade Journal
 
Tricks
Neaples Italy
 
Posts: 2 since Mar 2015
Thanks Given: 0
Thanks Received: 0


I just saw it can be done using the 'Slippage' options from the Backtester.

I use Slippage instead of Commission so, for a 1 pip spread I set a 0,5 slippage.

Slippage can also be set through NinjaScript and the 'Slippage' keyword.


 



Last Updated on March 25, 2015


© 2024 NexusFi™, s.a., All Rights Reserved.
Av Ricardo J. Alfaro, Century Tower, Panama City, Panama, Ph: +507 833-9432 (Panama and Intl), +1 888-312-3001 (USA and Canada)
All information is for educational use only and is not investment advice. There is a substantial risk of loss in trading commodity futures, stocks, options and foreign exchange products. Past performance is not indicative of future results.
About Us - Contact Us - Site Rules, Acceptable Use, and Terms and Conditions - Privacy Policy - Downloads - Top
no new posts