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 CarlTrading, 03-31-2026, 09:41 PM
      1 response
      72 views
      0 likes
      Last Post NinjaTrader_ChelseaB  
      Started by CarlTrading, 04-01-2026, 02:41 AM
      0 responses
      39 views
      0 likes
      Last Post CarlTrading  
      Started by CaptainJack, 03-31-2026, 11:44 PM
      0 responses
      63 views
      2 likes
      Last Post CaptainJack  
      Started by CarlTrading, 03-30-2026, 11:51 AM
      0 responses
      63 views
      0 likes
      Last Post CarlTrading  
      Started by CarlTrading, 03-30-2026, 11:48 AM
      0 responses
      53 views
      0 likes
      Last Post CarlTrading  
      Working...
      X