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 Geovanny Suaza, 02-11-2026, 06:32 PM
    0 responses
    670 views
    0 likes
    Last Post Geovanny Suaza  
    Started by Geovanny Suaza, 02-11-2026, 05:51 PM
    0 responses
    379 views
    1 like
    Last Post Geovanny Suaza  
    Started by Mindset, 02-09-2026, 11:44 AM
    0 responses
    111 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by Geovanny Suaza, 02-02-2026, 12:30 PM
    0 responses
    575 views
    1 like
    Last Post Geovanny Suaza  
    Started by RFrosty, 01-28-2026, 06:49 PM
    0 responses
    582 views
    1 like
    Last Post RFrosty
    by RFrosty
     
    Working...
    X