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 07-23-2012, 02:30 AM   #1
anyaM
Junior Member
 
Join Date: Mar 2012
Posts: 9
Thanks: 1
Thanked 0 times in 0 posts
Default Strategy fills above market price for Market Replay

Hi,

The strategy executes above the market price.
I did read this : http://www.ninjatrader.com/support/f...ad.php?t=42337

I do understand that my chart is based on last, and strategy will execute at best bid/ask for more realistic result. But isn't chart then supposed to catch up with that executed price at some point?
In my case it never does for next 2 bars (See the picture attached).

This is market replay on forex 10 min bar.
Filled at 1:11:24 @ 1.3243

Is there anything I don't know? Some special execution rules?

Thanks!
Attached Images
File Type: jpg wrongpricefill.jpg (28.3 KB, 14 views)
anyaM is offline  
Reply With Quote
Old 07-23-2012, 02:43 AM   #2
NinjaTrader_Bertrand
NinjaTrader Customer Service
 
NinjaTrader_Bertrand's Avatar
 
Join Date: Sep 2008
Location: Germany
Posts: 22,377
Thanks: 252
Thanked 966 times in 949 posts
Default

Hi anyaM, you're correct you see this as the chart is showing the last price, while executions are done on the bid / ask (in replay, live / sim trading).

The chart would not catch up, in FX the bid price is normally charted since no real Last exists. Thus the Ask price series would always run higher than the bid / last in your case.
NinjaTrader_Bertrand is offline  
Reply With Quote
The following user says thank you to NinjaTrader_Bertrand for this post:
Old 07-23-2012, 03:18 AM   #3
anyaM
Junior Member
 
Join Date: Mar 2012
Posts: 9
Thanks: 1
Thanked 0 times in 0 posts
Default

Quote:
Originally Posted by NinjaTrader_Bertrand View Post
Hi anyaM, you're correct you see this as the chart is showing the last price, while executions are done on the bid / ask (in replay, live / sim trading).

The chart would not catch up, in FX the bid price is normally charted since no real Last exists. Thus the Ask price series would always run higher than the bid / last in your case.

Thanks Bertrand, just to repeat so we are on the same page. In real life situation the chart will catch up since it would be a real trade executed on a market, but since its just a simulation, and the trade doesn't affect the market, the price doesn't reach that point. Is that right?
anyaM is offline  
Reply With Quote
Old 07-23-2012, 03:21 AM   #4
NinjaTrader_Bertrand
NinjaTrader Customer Service
 
NinjaTrader_Bertrand's Avatar
 
Join Date: Sep 2008
Location: Germany
Posts: 22,377
Thanks: 252
Thanked 966 times in 949 posts
Default

No, in FX the charts are driven by the bidprice, so the Ask quoted would always be higher (as it includes the spread you pay), thus any execution on the buy side will be charted out of the bid based bars then.
NinjaTrader_Bertrand is offline  
Reply With Quote
Old 07-23-2012, 04:01 AM   #5
anyaM
Junior Member
 
Join Date: Mar 2012
Posts: 9
Thanks: 1
Thanked 0 times in 0 posts
Default

Quote:
Originally Posted by NinjaTrader_Bertrand View Post
No, in FX the charts are driven by the bidprice, so the Ask quoted would always be higher (as it includes the spread you pay), thus any execution on the buy side will be charted out of the bid based bars then.
Sorry, im confused.
If my chart is showing best bid price, instead of last. and the order that i mention BUY 1 @ 1.3243 gets filled, shouldn't the chart reach that price mark then?

In my mind for buy order to execute, the price of this order has to become the best bid price for awhile, am i wrong?
anyaM is offline  
Reply With Quote
Old 07-23-2012, 04:20 AM   #6
NinjaTrader_Bertrand
NinjaTrader Customer Service
 
NinjaTrader_Bertrand's Avatar
 
Join Date: Sep 2008
Location: Germany
Posts: 22,377
Thanks: 252
Thanked 966 times in 949 posts
Default

You are not trading a futures contract or equity here, but spot FX directly with your broker - so there's no unified exchange / price / market available. You get a quote to buy and one to sell from your broker directly who participates 'for you' in the bigger interbank market.
NinjaTrader_Bertrand is offline  
Reply With Quote
Old 07-23-2012, 05:59 AM   #7
anyaM
Junior Member
 
Join Date: Mar 2012
Posts: 9
Thanks: 1
Thanked 0 times in 0 posts
Default

Quote:
Originally Posted by NinjaTrader_Bertrand View Post
You are not trading a futures contract or equity here, but spot FX directly with your broker - so there's no unified exchange / price / market available. You get a quote to buy and one to sell from your broker directly who participates 'for you' in the bigger interbank market.
Ok, stops on FX logic. Does a sell stop wait until = best bid and a buy stop wait until = best ask as i would expect?

thanks
anyaM is offline  
Reply With Quote
Old 07-23-2012, 06:50 AM   #8
NinjaTrader_Bertrand
NinjaTrader Customer Service
 
NinjaTrader_Bertrand's Avatar
 
Join Date: Sep 2008
Location: Germany
Posts: 22,377
Thanks: 252
Thanked 966 times in 949 posts
Default

Yes, Buy Stops would be triggered by the ask and Sell Stops by the bid.
NinjaTrader_Bertrand is offline  
Reply With Quote
Old 10-24-2012, 11:20 AM   #9
neoikon
Senior Member
 
Join Date: Oct 2008
Location: Austin, TX
Posts: 119
Thanks: 44
Thanked 5 times in 4 posts
Default

Quote:
Originally Posted by NinjaTrader_Bertrand View Post
Yes, Buy Stops would be triggered by the ask and Sell Stops by the bid.
In SIM, is there a way to change this behavior to "last" or an actual executed trade before triggering a stop?

It's frustrating to get stopped out many pips away from actual market movement, especially when the market never trades at the price set by the stop.

Thanks!
neoikon is offline  
Reply With Quote
Old 10-24-2012, 11:51 AM   #10
NinjaTrader_Bertrand
NinjaTrader Customer Service
 
NinjaTrader_Bertrand's Avatar
 
Join Date: Sep 2008
Location: Germany
Posts: 22,377
Thanks: 252
Thanked 966 times in 949 posts
Default

Unfortunately that would not be configurable neoikon. I will add this request though to our feedback tracking lists in product management.
NinjaTrader_Bertrand is offline  
Reply With Quote
Reply

Tags
market replay

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
Market Replay & Fills neb1998 Strategy Analyzer 1 07-12-2011 03:12 PM
Strategy Fills at Wrong Price for Market Replay KBJ Strategy Development 6 07-07-2011 08:53 PM
Multiple fills on market replay bulegila Miscellaneous Support 3 01-14-2011 03:33 AM
Market Replay Fills vs Live Real Money Fills Lusitano Strategy Development 1 03-02-2009 09:38 AM
market replay getting numerous fills deanrumble Automated Trading 8 09-17-2008 09:01 AM


All times are GMT -6. The time now is 04:14 PM.