Login Page - Create Account

Support Board


Date/Time: Fri, 14 Mar 2025 06:46:43 +0000



Post From: Place single order at time

[2022-05-31 19:00:22]
JDCII2112 - Posts: 21
Good morning everyone,

I am building a time based ASCIL system and using the documentation provided by Sierra I have made the following code snippet:

//ALLOWS SC TO GET TIME FROM INPUTS AND SETS TIME TRIGGER
    
SCDateTime TimeToCheckFor;
int CurrentDate = sc.BaseDateTimeIn[sc.ArraySize -1].GetDate();
TimeToCheckFor.SetDate(CurrentDate);
TimeToCheckFor.SetTimeHMS_MS(Entry_Hour.GetInt(),Entry_Minute.GetInt(),Entry_Second.GetInt(),Entry_Millisecond.GetInt());
  
//ENTRY
if (sc.IsDateTimeContainedInBarIndex(TimeToCheckFor, sc.Index) )
{
//order parameters
}


This code executes at the specified time parameters and places the order however it places an infinite amount of orders, and will continue to do so endlessly it seems.

How do I get the code to only execute *ONCE* at the specified time?

Thanks in advance for anyone who can help me out.

I already tried to use the sc.MaximumPositionAllowed parameter and no good. Messed with all the parameters and no help really.