i have one issue, i have my strategy script and i do backtest in FOREX. I need to set some fix spread to my backtest, is it possible ?
Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
How to set spreads to backtest
Collapse
X
-
I thought that, it can be slippage, i use market and limit orders. Let me know if understand properly.
If i set slippage 2, Is it gonna behave like spread ? So i will got spread going "in" and going "out" of position ?
I have set half pips, so if i wanna simulate spread 5, have i set slippage 10 ? am i correct ?
thanks for reply !
Comment
-
-
Correct as far as the slippage goes. If you have bid / ask data you could create for example a MultiSeries script as well to execute on those series and thus include the spread.
Another option would be adding in a commission 'penalty' for the script to simulate the spread.BertrandNinjaTrader Customer Service
Comment
-
Is there a posibility to do executions outside of bar, in backtest ? Because in real time trading it has happend. I am trying as accurately as possible to be close to results between backtest and real time trading. The option of adding more commisions its good idea, but it doesnt reflect entry prices and exit prices like spread, as you know. Thank you a lot !
And second question, after you advice, may i write script with simulated spreads ? Do you have any useful link ? Thank you!
Comment
-
We would not have really documented this unsupported area, but there would be the possibility to work with a customized filltype that would determine how you want your fills to come back, for example consider this simple snippet for market order fills -
if (order.OrderType == OrderType.Market)
{
if (order.OrderAction == Cbi.OrderAction.Buy || order.OrderAction == Cbi.OrderAction.BuyToCover) // set fill price
FillPrice = (NextOpen + SlippagePoints);
else
FillPrice = (NextOpen - SlippagePoints);
}
Here we then just say use the next open price +- my entered slippage per execution - this is contrast to the default type limiting that to the Min Max of that price vs the bar high / low.
Here would be an example for getting started sending orders to another internal added series - http://www.ninjatrader.com/support/f...ead.php?t=6652
This would not need to be another timeframe, but could also be a bid / ask price series (MarketDataType).
Attached FilesBertrandNinjaTrader Customer Service
Comment
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by Belfortbucks, Today, 09:29 PM
|
0 responses
3 views
0 likes
|
Last Post
by Belfortbucks
Today, 09:29 PM
|
||
Started by zstheorist, Today, 07:52 PM
|
0 responses
7 views
0 likes
|
Last Post
by zstheorist
Today, 07:52 PM
|
||
Started by pmachiraju, 11-01-2023, 04:46 AM
|
8 responses
150 views
0 likes
|
Last Post
by rehmans
Today, 06:44 PM
|
||
Started by mattbsea, Today, 05:44 PM
|
0 responses
6 views
0 likes
|
Last Post
by mattbsea
Today, 05:44 PM
|
||
Started by RideMe, 04-07-2024, 04:54 PM
|
6 responses
33 views
0 likes
|
Last Post
by RideMe
Today, 05:31 PM
|
Comment