Support Board
Date/Time: Tue, 06 May 2025 04:34:34 +0000
Post From: ACSIL indicator to retrieve
[2025-01-16 21:03:07] |
cmet - Posts: 690 |
Well, if the data is provided through account balance, here's the part that shows the balance and available funds without the automatic trade management. This will just grab the data and print text on main chart pane. #include "sierrachart.h"
SCDLLName("Funds & Cash Balance"); SCSFExport scsf_AvailableFundsCashBalance(SCStudyInterfaceRef sc) { SCSubgraphRef Subgraph_TextDisplay = sc.Subgraph[0]; SCInputRef Input_FontSize = sc.Input[0]; SCInputRef Input_FontColor = sc.Input[1]; if (sc.SetDefaults) { sc.GraphName = "Funds & Cash Balance"; sc.StudyDescription = "Display Available Funds and Cash Balance"; sc.GraphRegion = 0; sc.AutoLoop = 0; sc.UpdateAlways = 1; Subgraph_TextDisplay.Name = "Text Display"; Subgraph_TextDisplay.DrawStyle = DRAWSTYLE_CUSTOM_TEXT; Subgraph_TextDisplay.PrimaryColor = RGB(255, 255, 255); Subgraph_TextDisplay.LineWidth = 10; Subgraph_TextDisplay.DrawZeros = false; Input_FontSize.Name = "Font Size"; Input_FontSize.SetInt(10); Input_FontSize.SetIntLimits(8, 50); Input_FontColor.Name = "Font Color"; Input_FontColor.SetColor(RGB(255, 255, 255)); return; } if (sc.LastCallToFunction) { sc.DeleteUserDrawnACSDrawing(sc.ChartNumber, 1001); return; } int FontSize = Input_FontSize.GetInt(); COLORREF FontColor = Input_FontColor.GetColor(); n_ACSIL::s_TradeAccountDataFields TradeAccountData; if (sc.GetTradeAccountData(TradeAccountData, sc.SelectedTradeAccount)) { float AvailableFunds = static_cast<float>(TradeAccountData.m_AvailableFundsForNewPositions); float CashBalance = static_cast<float>(TradeAccountData.m_CurrentCashBalance); float ProfitOrLoss = CashBalance - AvailableFunds; SCString DisplayText; DisplayText.Format("Available Funds: %.2f Cash Balance: %.2f P/L: %.2f", AvailableFunds, CashBalance, ProfitOrLoss); s_UseTool TextTool; TextTool.Clear(); TextTool.ChartNumber = sc.ChartNumber; TextTool.DrawingType = DRAWING_TEXT; TextTool.Region = sc.GraphRegion; TextTool.FontSize = FontSize; TextTool.FontBold = true; TextTool.Color = FontColor; TextTool.Text = DisplayText; TextTool.AddAsUserDrawnDrawing = 1; TextTool.AllowSaveToChartbook = 1; TextTool.LineNumber = 1001; TextTool.BeginDateTime = 10; TextTool.BeginValue = 90; TextTool.UseRelativeVerticalValues = true; sc.UseTool(TextTool); } } Date Time Of Last Edit: 2025-01-16 23:48:53
|