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 DannyP96, 05-18-2026, 02:38 PM
      1 response
      27 views
      0 likes
      Last Post NinjaTrader_ChelseaB  
      Started by CarlTrading, 05-11-2026, 05:56 AM
      0 responses
      117 views
      0 likes
      Last Post CarlTrading  
      Started by CarlTrading, 05-10-2026, 08:12 PM
      0 responses
      69 views
      0 likes
      Last Post CarlTrading  
      Started by Hwop38, 05-04-2026, 07:02 PM
      0 responses
      226 views
      0 likes
      Last Post Hwop38
      by Hwop38
       
      Started by CaptainJack, 04-24-2026, 11:07 PM
      0 responses
      414 views
      0 likes
      Last Post CaptainJack  
      Working...
      X