Login Page - Create Account

Support Board


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



Post From: Beginner ACSIL help please

[2024-11-26 08:54:31]
User431178 - Posts: 667
PositionData is empty until you call the GetTradePosition function.
Automated Trading From an Advanced Custom Study: sc.GetTradePosition



s_SCPositionData PositionData;
sc.GetTradePosition(PositionData);



To be honest, I am not sure if the error is the bar time. Because I added the following with a stipulation for "Second", and the orders are still produced repeatedly for the duration of the 15 minute bar.

The bar time is the time at the beginning of the bar, it does not change (though you could use the end datetime).
ACSIL Interface Members - Variables and Arrays: sc.BaseDataEndDateTime[]



s_SCPositionData PositionData;
sc.GetTradePosition(PositionData);

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

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


}

I second the advice offered by @seandunaway, you might also find some useful tips from the videos these guys have on youtube.

https://www.youtube.com/@FrozenTundraTrader
https://www.youtube.com/@VerrilloTrading