Login Page - Create Account

Support Board


Date/Time: Thu, 02 May 2024 06:12:19 +0000



[Programming Help] - How to know that IB Trade workstation position was opened by ACSIL script?

View Count: 718

[2019-09-26 11:32:17]
User424475 - Posts: 3
For example script send
sc.BuyEntry on chart with symbol name = "NIFTY50 IND-OPT-20190926-11450-C-NSE-1-INR-NIFTY"

IB open position with symbol name = "NIFTY50-OPT-20190926-11450-C-NSE-1-INR"

now if call
s_SCPositionData pd;
sc.GetTradePositionForSymbolAndAccount(pd, sc.Symbol, sc.SelectedTradeAccount);

pd.PositionQuantity return 0.0 quantity
--------------------------------------------

symbol name on IB not equal symbol name on Sierrachart
--------------
how ACSIL script can know that this position was opened using sc.BuyEntry? how figure out correct symbol name to use in call to GetTradePositionForSymbolAndAccount?
[2019-09-26 21:23:52]
Sierra Chart Engineering - Posts: 104368
Why not use this symbol when submitting the order:
NIFTY50-OPT-20190926-11450-C-NSE-1-INR
Sierra Chart Support - Engineering Level

Your definitive source for support. Other responses are from users. Try to keep your questions brief and to the point. Be aware of support policy:
https://www.sierrachart.com/index.php?l=PostingInformation.php#GeneralInformation

For the most reliable, advanced, and zero cost futures order routing, *change* to the Teton service:
Sierra Chart Teton Futures Order Routing
[2019-09-27 05:20:36]
User424475 - Posts: 3
if order send with symbol name "NIFTY50-OPT-20190926-11450-C-NSE-1-INR"

IB open position with symbol name "NIFTY50-OPT-20190926 15:30 IST-11450-C-NSE-1-INR"

-----------
I need found way to track positions opened by ASCIL script...
-----------
question:
why when specify incorrect symbol name (for exmaple "NIFTY50-OPT-20191003-11550-P-NSE-1-INR") it open position on IB with symbol name = "NIFTY50-OPT-20191003 15:30 IST-11550-P-NSE-1-INR"????
Date Time Of Last Edit: 2019-09-27 07:26:57
[2019-09-28 08:53:47]
Sierra Chart Engineering - Posts: 104368
We are going to fix this:
20190926 15:30 IST

And filter out everything after the date. This will be out in the next release.

We do not know the answer to your question.
Sierra Chart Support - Engineering Level

Your definitive source for support. Other responses are from users. Try to keep your questions brief and to the point. Be aware of support policy:
https://www.sierrachart.com/index.php?l=PostingInformation.php#GeneralInformation

For the most reliable, advanced, and zero cost futures order routing, *change* to the Teton service:
Sierra Chart Teton Futures Order Routing
[2019-09-28 17:17:16]
User424475 - Posts: 3
should i use something like that? this turn string "NIFTY50 IND-OPT-20190926 15:30 IST-11450-C-NSE-1-INR" to "NIFTY50-OPT-20190926-11450-C-NSE-1-INR".
SCString fixSymName(SCString str)
{
  SCString array[1000];
  int cnt=0;
  int s,e;
  s=0;
  bool end=false;
  while(true)
  {
    int e=str.IndexOf('-',s);
    if(e==-1)
    {
      e=str.GetLength();
      end=true;
    }
    array[cnt]=str.GetSubString(e-s,s);
    int i=array[cnt].IndexOf(' ');
    if(i!=-1)
      array[cnt]=array[cnt].GetSubString(i,0);
    cnt++;
    if(end) break;
    s=e+1;
  }
  SCString out=array[0];
  for(int k=1;k<cnt;k++)
  {
    out=out+"-"+array[k];
  }
  return out;
}


----------------
if(fixSymName(OrderDetails.Symbol).CompareNoCase(fixSymName(sc.GetTradeSymbol())) != 0) continue;
if(fixSymName(PositionDetails.Symbol).CompareNoCase(fixSymName(sc.GetTradeSymbol())) != 0) continue;
----------------
???
[2019-09-30 19:56:18]
Sierra Chart Engineering - Posts: 104368
This is a programming help question and we are totally declining it. We are not going to waste our valuable time with this Interactive Brokers crap like this.
Sierra Chart Support - Engineering Level

Your definitive source for support. Other responses are from users. Try to keep your questions brief and to the point. Be aware of support policy:
https://www.sierrachart.com/index.php?l=PostingInformation.php#GeneralInformation

For the most reliable, advanced, and zero cost futures order routing, *change* to the Teton service:
Sierra Chart Teton Futures Order Routing
Date Time Of Last Edit: 2019-09-30 19:56:36

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

Login

Login Page - Create Account