NexusFi: Find Your Edge


Home Menu

 





Backtesting and bid-ask spread


Discussion in NinjaTrader

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




 
Search this Thread

Backtesting and bid-ask spread

  #1 (permalink)
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.

Reply With Quote

Can you help answer these questions
from other members on NexusFi?
Trade idea based off three indicators.
Traders Hideout
NT7 Indicator Script Troubleshooting - Camarilla Pivots
NinjaTrader
How to apply profiles
Traders Hideout
REcommedations for programming help
Sierra Chart
MC PL editor upgrade
MultiCharts
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
What is Markets Chat (markets.chat) real-time trading ro …
76 thanks
Spoo-nalysis ES e-mini futures S&P 500
55 thanks
Just another trading journal: PA, Wyckoff & Trends
37 thanks
Bigger Wins or Fewer Losses?
24 thanks
The Program
16 thanks
  #2 (permalink)
 
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,461 since Jun 2009
Thanks Given: 33,235
Thanks Received: 101,657

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





Mike

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 Reply With Quote
  #3 (permalink)
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.

Reply With Quote




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