Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

What is going on here? Simple things not working.

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

    What is going on here? Simple things not working.

    Am I misunderstanding something? Can you not do this?

    Code:
     // Condition set 1
                if (CrossAbove(GetCurrentBid(), SMA(18), 1))
                {
                    PrintWithTimeStamp("bought");
                    EnterLong(DefaultQuantity, "Long");
                }
    I would of thought so. But with all the issues I'm having with something so simple. I'm not so sure. These problems are happening with Market Replay and v6.5 of NT.


    Just creating that simple script using the wizard.. Here are the issues:

    A) There is no trigger when the crossover happens.
    B) As soon as I start the script (even when the price is well below the SMA) I get all sorts of funky output showing that the conditions were met before anything was started and the price is far below the 18 SMA.


    Check out these time stamps on market replay data on 7/22/10!!!





    7/6/2010 2:10:00 AM bought

    7/6/2010 2:34:00 AM bought

    7/6/2010 4:01:00 AM bought

    7/6/2010 4:15:00 AM bought

    7/6/2010 4:21:00 AM bought

    7/6/2010 4:27:00 AM bought

    7/6/2010 4:41:00 AM bought

    7/6/2010 4:47:00 AM bought

    7/6/2010 7:36:00 AM bought

    7/6/2010 7:43:00 AM bought

    7/6/2010 8:10:00 AM bought

    7/6/2010 9:34:00 AM bought

    7/6/2010 9:35:00 AM bought

    7/6/2010 9:47:00 AM bought

    7/6/2010 9:53:00 AM bought

    7/6/2010 9:55:00 AM bought

    7/6/2010 11:00:00 AM bought

    7/6/2010 11:57:00 AM bought

    7/6/2010 3:25:00 PM bought

    7/6/2010 3:29:00 PM bought

    7/6/2010 3:36:00 PM bought

    7/6/2010 4:52:00 PM bought

    7/6/2010 5:16:00 PM bought

    7/6/2010 5:19:00 PM bought

    7/6/2010 5:20:00 PM bought

    7/6/2010 6:08:00 PM bought

    7/6/2010 8:00:00 PM bought

    7/6/2010 9:09:00 PM bought

    7/6/2010 9:40:00 PM bought

    7/7/2010 1:42:00 AM bought

    7/7/2010 1:47:00 AM bought

    7/7/2010 1:50:00 AM bought

    7/7/2010 2:30:00 AM bought

    7/7/2010 2:36:00 AM bought

    7/7/2010 3:10:00 AM bought

    7/7/2010 4:57:00 AM bought

    7/7/2010 5:02:00 AM bought

    7/7/2010 8:58:00 AM bought

    7/7/2010 11:38:00 AM bought

    7/7/2010 2:16:00 PM bought

    7/7/2010 4:20:00 PM bought

    7/7/2010 4:39:00 PM bought

    7/7/2010 5:05:00 PM bought

    7/7/2010 5:32:00 PM bought

    7/7/2010 7:04:00 PM bought

    7/7/2010 7:15:00 PM bought

    7/7/2010 9:47:00 PM bought

    7/7/2010 10:02:00 PM bought

    7/7/2010 10:57:00 PM bought

    7/8/2010 12:16:00 AM bought

    7/8/2010 1:18:00 AM bought

    7/8/2010 3:20:00 AM bought

    7/8/2010 4:29:00 AM bought

    7/8/2010 4:43:00 AM bought

    7/8/2010 7:11:00 AM bought

    7/8/2010 7:55:00 AM bought

    7/8/2010 8:16:00 AM bought

    7/8/2010 9:49:00 AM bought

    7/8/2010 11:23:00 AM bought

    7/8/2010 1:49:00 PM bought

    7/8/2010 2:15:00 PM bought

    7/8/2010 3:20:00 PM bought

    7/8/2010 4:29:00 PM bought

    7/8/2010 5:30:00 PM bought

    7/8/2010 8:22:00 PM bought

    7/9/2010 12:20:00 AM bought

    7/9/2010 12:53:00 AM bought

    7/9/2010 1:02:00 AM bought

    7/9/2010 1:46:00 AM bought

    7/9/2010 1:48:00 AM bought

    7/9/2010 1:59:00 AM bought

    7/9/2010 2:19:00 AM bought

    7/9/2010 3:32:00 AM bought

    7/9/2010 3:49:00 AM bought

    7/9/2010 5:03:00 AM bought

    7/9/2010 5:19:00 AM bought

    7/9/2010 7:54:00 AM bought

    7/9/2010 8:07:00 AM bought

    7/9/2010 8:12:00 AM bought

    7/9/2010 8:16:00 AM bought

    7/9/2010 8:27:00 AM bought

    7/9/2010 9:08:00 AM bought

    7/9/2010 11:23:00 AM bought

    7/9/2010 1:10:00 PM bought

    7/11/2010 3:11:00 PM bought

    7/11/2010 3:13:00 PM bought

    7/11/2010 3:14:00 PM bought

    7/11/2010 4:29:00 PM bought

    7/11/2010 5:56:00 PM bought

    7/11/2010 7:48:00 PM bought

    7/11/2010 9:40:00 PM bought

    7/11/2010 9:44:00 PM bought

    7/11/2010 9:50:00 PM bought

    7/11/2010 10:04:00 PM bought

    7/11/2010 10:12:00 PM bought

    7/12/2010 1:56:00 AM bought

    7/12/2010 7:34:00 AM bought

    7/12/2010 11:24:00 AM bought

    7/12/2010 11:35:00 AM bought

    7/12/2010 12:12:00 PM bought

    ... etc. ... etc
    It just goes on and on till todays date. Remember, I'm running this on Market Replay data from 7/22/10 (although the actual Market Data date doesn't matter, happens on any day I try)


    Can someone tell me what is going on? These two problem are giving me a case of the trembles!!

    #2
    Hi lookOutBelow,

    Where are you applying this? To a chart? It would definitely run on historical data in that case. If you want to avoid that, you can use "Historical":


    As far as the orders go, you would only see live orders working, but if you suspect they are being ignored or cancelled, you can monitor them with TraceOrders:
    TimNinjaTrader Customer Service

    Comment


      #3
      I'm applying this by right clicking in the Strategy tab and running it while connected to a market replay on 7/22 (date not important, same results). That is the problem, it is showing time stamps from dates way outside the market replay data I'm using.

      Keep in mind, this output is happening as soon as I click "start". If I clear the output window, it doesn't do it again until I stop/start the strategy again.


      I added the TraceOrders. Here is just 1 of dozens of results from the output window. Why would it show output from dates clearly outside the market replay date I'm using??

      Also keep in mind, this ONLY happens when using GetCurrentBid or GetCurrentAsk to see if it has crossed over a SMA. Everything works when I change the GetCurrentBid to another SMA.


      7/6/2010 12:59:00 AM Entered internal PlaceOrder() method at 7/6/2010 12:59:00 AM: Action=SellShort OrderType=Market Quantity=2 LimitPrice=0 StopPrice=0 SignalName='Short' FromEntrySignal=''
      7/6/2010 1:38:00 AM Cancelled pending exit order, since associated position is closed: Order='NT-00002/Replay101' Name='Profit target' State=Working Instrument='ES 09-10' Action=BuyToCover Limit price=1020.75 Stop price=0 Quantity=2 Strategy='centerline1CMAN' Type=Limit Tif=Gtc Oco='NT-00000' Filled=0 Fill price=0 Token='1129ac6c09194789956ed26cc7e9aca1' Gtd='12/1/2099 12:00:00 AM'
      7/6/2010 1:38:00 AM Cancelled OCO paired order: BarsInProgress=0: Order='NT-00002/Replay101' Name='Profit target' State=Cancelled Instrument='ES 09-10' Action=BuyToCover Limit price=1020.75 Stop price=0 Quantity=2 Strategy='centerline1CMAN' Type=Limit Tif=Gtc Oco='NT-00000' Filled=0 Fill price=0 Token='1129ac6c09194789956ed26cc7e9aca1' Gtd='12/1/2099 12:00:00 AM'
      7/6/2010 2:10:00 AM Entered internal PlaceOrder() method at 7/6/2010 2:10:00 AM: Action=Buy OrderType=Market Quantity=2 LimitPrice=0 StopPrice=0 SignalName='Long' FromEntrySignal=''
      7/6/2010 2:10:00 AM Got into buy loop







      Originally posted by NinjaTrader_Tim View Post
      Hi lookOutBelow,

      Where are you applying this? To a chart? It would definitely run on historical data in that case. If you want to avoid that, you can use "Historical":


      As far as the orders go, you would only see live orders working, but if you suspect they are being ignored or cancelled, you can monitor them with TraceOrders:
      http://www.ninjatrader.com/support/f...ead.php?t=3627

      Comment


        #4
        Hi lookOutBelow,

        What is your "Days to load" setting when you apply the Strategy?
        TimNinjaTrader Customer Service

        Comment


          #5
          Originally posted by NinjaTrader_Tim View Post
          Hi lookOutBelow,

          What is your "Days to load" setting when you apply the Strategy?
          I'm sorry. I don't see "Days to load" anywhere when starting the Strategy. Where do I find this? I see Min bars required (set at 20)?? I'm using 1min data btw.

          Comment


            #6
            Hi lookOutBelow,

            Please navigate to "Tool>Options>Data" to see how many days will be loaded by default. This is the number of days your strategy will be run on.
            TimNinjaTrader Customer Service

            Comment


              #7
              Originally posted by NinjaTrader_Tim View Post
              Hi lookOutBelow,

              Please navigate to "Tool>Options>Data" to see how many days will be loaded by default. This is the number of days your strategy will be run on.
              Ahh. Okay. This setting was changed since my original post. It now stands at 1 day for 1min bars.

              However, I do have an update. I may of gotten it to work. I'm not sure yet. Later today, when I have some time, I'll do some testing to be certain.

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by bmartz, Today, 09:30 AM
              2 responses
              11 views
              0 likes
              Last Post bltdavid  
              Started by f.saeidi, Today, 11:02 AM
              1 response
              4 views
              0 likes
              Last Post NinjaTrader_BrandonH  
              Started by geotrades1, Today, 10:02 AM
              4 responses
              12 views
              0 likes
              Last Post geotrades1  
              Started by rajendrasubedi2023, Today, 09:50 AM
              3 responses
              16 views
              0 likes
              Last Post NinjaTrader_BrandonH  
              Started by lorem, Today, 09:18 AM
              2 responses
              11 views
              0 likes
              Last Post NinjaTrader_ChelseaB  
              Working...
              X