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 bmartz, 03-12-2024, 06:12 AM
      5 responses
      32 views
      0 likes
      Last Post NinjaTrader_Zachary  
      Started by Aviram Y, Today, 05:29 AM
      4 responses
      13 views
      0 likes
      Last Post Aviram Y  
      Started by algospoke, 04-17-2024, 06:40 PM
      3 responses
      28 views
      0 likes
      Last Post NinjaTrader_Jesse  
      Started by gentlebenthebear, Today, 01:30 AM
      1 response
      8 views
      0 likes
      Last Post NinjaTrader_Jesse  
      Started by cls71, Today, 04:45 AM
      1 response
      8 views
      0 likes
      Last Post NinjaTrader_ChelseaB  
      Working...
      X