Login Page - Create Account

Support Board


Date/Time: Thu, 13 Mar 2025 01:12:24 +0000



[Programming Help] - Place single order at time

View Count: 371

[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.

To post a message in this thread, you need to log in with your Sierra Chart account:

Login

Login Page - Create Account