Login Page - Create Account

Support Board


Date/Time: Mon, 21 Apr 2025 16:13:10 +0000



[Programming Help] - Parts of ACSIL API work and other parts do not?

View Count: 64

[2025-04-17 20:14:10]
LTSys2 - Posts: 11
Hi,

I recently moved my sierra chart study project outside of the sierra chart ACS_Source folder and I'm building it using GNU C++.

Since I've done that parts of SC ACSIL code work and other parts do not.

For example... I am able to get positions fine but looping through orders does not.

Perhaps I am missing a SC ACSIL library that needs to be in my built study dll?

I have included the "sierrachart.h" header and everything compiles fine.



  // removed code that places an order...

  s_SCPositionData position;

  sc.GetTradePositionForSymbolAndAccount(position, "EURUSD", "Sim1"); // this function works

  // removed code that prints the positions

  s_SCTradeOrder order; int orderIndex = 0;

  while(sc.GetOrderForSymbolAndAccountByIndex("", "Sim1", orderIndex, order) != SCTRADING_ORDER_ERROR) { // this function never finds the order

   // never enters the loop even though several positions are open?
  }


TIA
Date Time Of Last Edit: 2025-04-17 22:19:12
[2025-04-17 20:32:15]
User431178 - Posts: 652
never enters the loop even though several positions are open?

Positions can exist without orders, once the order is filled it is gone.
So unless there are attached orders still "working" then it is feasible that no orders would be returned by that function.

Trading Information Windows: Automatic Clearing of Orders
[2025-04-17 20:40:01]
LTSys2 - Posts: 11
it is feasible that no orders would be returned by that function.

But the code should enter the loop at least once before the orders are cleared after X amount of time.

Thing is if I run the study that is built using sierra charts study builder it works. Building the study not using sierra chart's study builder only the sc.GetTradePositionForSymbolAndAccount function works? Thats why I'm thinking I must be missing some runtime setting or include?
Date Time Of Last Edit: 2025-04-17 20:41:13

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

Login

Login Page - Create Account