Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

Partner 728x90

Collapse

Filter Bad/Negative Ticks from within Strategy

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

    #16
    i made the refresh/reload command unconditional to Lows and only symbol based:

    if (Instrument.MasterInstrument.Name == "BANKNIFTY_I"
    )
    {
    System.Windows.Forms.SendKeys.Send("^(+R)");
    System.Windows.Forms.SendKeys.Send("{F5}");



    Print(" "+Instrument.FullName+" "+Open[1]+" "+High[1]+" "+Low[1]+" "+Close[1]);
    Print(" "+Instrument.FullName+" "+Open[0]+" "+High[0]+" "+Low[0]+" "+Close[0]);


    }

    Still faced the problems. Image attached.

    Another issue is that even if historical data gets sorted for a moment, incoming tick at which order gets executed, if negative, has no filter

    I can think of a few things to try now:
    1. A Do...Loop function to refresh/reload until lowest low >0 - CAN A DO...LOOP BE CODED IN NT7?
    2. OnMarketData()
    if Last[0] <0
    {
    refresh/reload
    }
    3. Limit Order with Limit price being Last[0]

    --
    if this particular symbol was not that important i would have left it untouched. But somehow, it is very important. Data vendor is working on the issue too but unable to sort it till now.
    Attached Files
    Last edited by piyushc; 07-06-2017, 01:11 PM.

    Comment


      #17
      All other windows refresh, except for the one i need the most.

      Snapshots attached.
      Attached Files

      Comment


        #18
        Hello piyushc,

        Thank you for your response.

        The following should be all you need to use. Can you confirm if you use the following that you still see the same behavior you detailed in your last two posts?
        Code:
        			if (Close[0] < 0)
        			{
        				System.Windows.Forms.SendKeys.Send("^(+R)");
        			}
        I look forward to your response.

        Comment


          #19
          Looks simplistic and sufficient but i'll try that.

          Another issue is the Strategy Execution happens at the incoming tick, how do i sort that if it's negative?

          Options that i thought of:
          1. MarketDataType.Last > 0
          2. Limit Order Execution at Last price

          What's your say on it?

          Or, if you can have any better idea.. please

          Comment


            #20
            Hello piyushc,

            Thank you for your response.

            I would perform the check before anything else in OnBarUpdate. This way the data is reloaded if incorrect before placing any orders or checking any conditions.

            Please let me know if you have any questions.

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by cre8able, Today, 03:20 PM
            1 response
            9 views
            0 likes
            Last Post cre8able  
            Started by fiddich, Today, 05:25 PM
            0 responses
            3 views
            0 likes
            Last Post fiddich
            by fiddich
             
            Started by gemify, 11-11-2022, 11:52 AM
            6 responses
            804 views
            2 likes
            Last Post ultls
            by ultls
             
            Started by ScottWalsh, Today, 04:52 PM
            0 responses
            4 views
            0 likes
            Last Post ScottWalsh  
            Started by ScottWalsh, Today, 04:29 PM
            0 responses
            7 views
            0 likes
            Last Post ScottWalsh  
            Working...
            X