Login Page - Create Account

Support Board


Date/Time: Wed, 07 May 2025 15:55:11 +0000



Post From: Beginner ACSIL help please

[2024-11-26 00:33:00]
User745789 - Posts: 377
Thanks for taking the time to reply.

But I have not found much mention of "order tracking" in the docs. Can you provide a bit more guidance in that regard?

I need to work out if there is an existing working order, I think it might involve this? Automated Trading From an Advanced Custom Study: IsWorkingOrderStatus()

And maybe these two
https://www.sierrachart.com/index.php?l=doc/ACSILTrading.html#GettingOrderInformation
Automated Trading From an Advanced Custom Study: sc.GetOrderByIndex

I also found this in the SC forum, but no mention of it in the docs: PositionData.WorkingOrdersExist

So I tried this, but the compiler doesn't like it. I have to declare PositionData, which I am trying to do without success.

int Hour = BarDateTime.GetHour();
int Minute = BarDateTime.GetMinute();
int Second = BarDateTime.GetSecond();
int workingOrderExists = PositionData.WorkingOrdersExist();
if(Hour == 10 && Minute == 45 && Second == 0 && !workingOrderExists) {

This example code form SC Engineering uses && !PositionData.WorkingOrdersExist seemingly without declaring it, but I cant find a way to use it in the same manner...
Simple ACSIL example to scale in to a trade

Here is my attempt. Compiler tells me "error: 'PositionData' was not declared in this scope; did you mean 's_SCPositionData'?".

int Hour = BarDateTime.GetHour();
int Minute = BarDateTime.GetMinute();
int Second = BarDateTime.GetSecond();
//int workingOrderExists = PositionData.WorkingOrdersExist();
if(Hour == 10 && Minute == 45 && Second == 0 && !PositionData.WorkingOrdersExist) {

So I looked on the internet and found a hint, this is what I have and it compiles! But I still get rapidly incrementing new orders being added, so I think && !PositionData.WorkingOrdersExist isn't working as hoped.

s_SCPositionData PositionData;
  
int Hour = BarDateTime.GetHour();
int Minute = BarDateTime.GetMinute();
int Second = BarDateTime.GetSecond();

if(Hour == 10 && Minute == 45 && Second == 0 && !PositionData.WorkingOrdersExist) {

I have no idea how to use the above properly. Sorry for all these details, I am trying to demonstrate what I have attempted myself before asking for help :)

I tried these, but didn't work, but I am not surprised.

sc.AllowMultipleEntriesInSameDirection = false;
sc.MaximumPositionAllowed = 1;

And my ongoing concern, why didn't the "Seconds == 0" condition work?
Date Time Of Last Edit: 2024-11-26 01:25:46