Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Filter out ticks from order processing

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Filter out ticks from order processing

    I'm trying to filter out ticks in historical data that are spikes on a 1 tick chart.

    I want to do this by editing the FillType and somehow reference the price of the last bar. How do I do this? All I see is NextLow and NextHigh. I tried caching it as LastNextLow, but it didn't seem to work.

    Also, where can I find a list of methods that can be overridden for Strategy.cs? And where on the filesystem is Strategy.cs?

    Thanks!

    #2
    uprz23, I will have someone get back to you tomorrow.
    AustinNinjaTrader Customer Service

    Comment


      #3
      Ok I think I figured it out. I added.

      Code:
      	[Gui.Design.DisplayName("Default")]
      	public class DefaultFillType : FillType
      	{
      		private		const double	epsilon			= 0.00000001;
      		private double lastPrice = -1; // cache the last price
      		
      	
      		public override void Fill(Order order)
      		{ 
       
      		...
      	        if (((order.OrderAction == Cbi.OrderAction.Buy && order.LimitPrice > nextLow + epsilon  )
      						|| (order.OrderAction == Cbi.OrderAction.BuyToCover	&& order.LimitPrice > nextLow + epsilon )
      						|| (order.OrderAction == Cbi.OrderAction.Sell			&& order.LimitPrice < nextHigh - epsilon  )
      						|| (order.OrderAction == Cbi.OrderAction.SellShort	&& order.LimitPrice < nextHigh - epsilon)) 
      						&& Math.Abs(NextLow - lastPrice) < 0.05   // ignore ticks 5 cents from last tick
      						)
      					FillPrice = order.LimitPrice;		
      					
                      ...
                     lastPrice = NextLow;
      I hope there will be no multithread timing issues here.
      Last edited by uprz23; 06-12-2011, 08:57 PM.

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by Jonker, 04-27-2024, 01:19 PM
      3 responses
      21 views
      0 likes
      Last Post NinjaTrader_Manfred  
      Started by businessman1929, 04-29-2024, 01:28 PM
      2 responses
      21 views
      0 likes
      Last Post businessman1929  
      Started by bltdavid, 03-27-2023, 05:32 AM
      18 responses
      346 views
      0 likes
      Last Post ETFVoyageur  
      Started by NM_eFe, Today, 05:15 PM
      0 responses
      4 views
      0 likes
      Last Post NM_eFe
      by NM_eFe
       
      Started by vitaly_p, Today, 05:09 PM
      0 responses
      4 views
      0 likes
      Last Post vitaly_p  
      Working...
      X