Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Orders auto placed at the wrong time

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

    Orders auto placed at the wrong time

    Hello

    This morning I placed my order via the my automated strategy and it placed the order at the wrong time.

    It is only supposed to place the order when the 10:00 candle starts (9:00 AM Computer time, but 10:00 candle time stamp). I set the order at about 8:45 and expected that it would auto place the order when my computer reached 9:0 am

    Here is the code that deals with that particular order placement:

    Code:
    			else if (direction == TrendDirection.Down)
    			{
    				if (ShortEntry == null
    				     && ToTime(Time[0]) == ToTime(endRangeHr,endRangeMin,00) 
    				     && ToTime(Time[0]) < ToTime(removeOrderHr, removeOrderMin,0)
    				     && restrictTrade == false)
    				{
    					ShortEntry = EnterShortStop(0, true, positionSize, ShortEntryPrice, "BreakoutShort");
    				}
    Here is the Properties section for the user defined input that would deal with this also:

    Code:
            [Description("Range End Hour")]
            [GridCategory("Parameters")]
    		[Gui.Design.DisplayName("2 End Range Hr")]
            public int EndRangeHr
            {
                get { return endRangeHr; }
                set { endRangeHr = value; }
            }
    Attached also are two screenshots. One is a screenshot of the strategy in the Strategies Tab showing how I had it set and the second one is the actual Edit Strategies window showing how it is set.

    I can not find any reason why this would have set the order prior to the 10:00 Candle (9:00 Computer time). Can you please see if you can find a possibility and let me know.

    Thank you!
    Attached Files

    #2
    jg123, I don't see a reason from the info presented but it would not be enough to make any conclusions, whenever something that appears debug prints would come in very handy to understand which values / states your variable had that effected the trigger of the order placement in your code, namely this part :

    if (ShortEntry == null
    && ToTime(Time[0]) == ToTime(endRangeHr,endRangeMin,00)
    && ToTime(Time[0]) < ToTime(removeOrderHr, removeOrderMin,0)
    && restrictTrade == false)

    There must be an item that would differently evaluating this morning from what you expected - you also want to be keeping in mind that NT stamps the bar with their closing times.

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by charlesugo_1, 05-26-2026, 05:03 PM
    0 responses
    64 views
    0 likes
    Last Post charlesugo_1  
    Started by DannyP96, 05-18-2026, 02:38 PM
    1 response
    149 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by CarlTrading, 05-11-2026, 05:56 AM
    0 responses
    162 views
    0 likes
    Last Post CarlTrading  
    Started by CarlTrading, 05-10-2026, 08:12 PM
    0 responses
    99 views
    0 likes
    Last Post CarlTrading  
    Started by Hwop38, 05-04-2026, 07:02 PM
    0 responses
    286 views
    0 likes
    Last Post Hwop38
    by Hwop38
     
    Working...
    X