Login Page - Create Account

Support Board


Date/Time: Fri, 26 Apr 2024 16:54:12 +0000



Impossible to have information on current positions

View Count: 424

[2021-07-23 14:57:10]
algo221 - Posts: 3
Hello.

I try to access the number of positions but the results always return 0.
While there are many positions open on the current symbol.
I tried several possible options but the results always return 0.


#include "sierrachart.h"

SCDLLName(" footprint") ;

SCSFExport scsf_footprint(SCStudyInterfaceRef sc)
{
  if (sc.SetDefaults)
    {  
      sc.AllowMultipleEntriesInSameDirection = 1;
      sc.AllowOppositeEntryWithOpposingPositionOrOrders = 1;  
      sc.UsesMarketDepthData=1;
      return;
    }  
    
  s_SCPositionData PositionData1;
  int infopos=sc.GetTradePositionForSymbolAndAccount(PositionData1,sc.Symbol,sc.SelectedTradeAccount);
  SCString msg;
  msg.Format("%d",PositionData1.PositionQuantity);
  sc.AddMessageToLog(msg,0);
}

[2021-07-24 22:12:23]
Sierra Chart Engineering - Posts: 104368
Are these simulated or non-simulated positions?
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
[2021-07-25 11:07:44]
algo221 - Posts: 3
It's simulation.
[2021-07-25 15:20:36]
bradh - Posts: 854
PositionQuantity is an integer. Try this:

msg.Format("%i",PositionData1.PositionQuantity);

[2021-07-26 03:23:10]
Sierra Chart Engineering - Posts: 104368
Is Trade >> Trade Simulation Mode enabled?
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

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

Login

Login Page - Create Account