I'm trying to use an old Function in order to create an AccountEquity StopLoss, but when I use it in my Signals, the function gives me an error: "GetBDAccountEquity function is not implemented".
Can anyone help me?
I enclose the Function AccountEqutyStop_X that I use
Code: Select all
// AccountEquityStop_X
Input: EquityStopAlert(numeric), // Set Stop Loss Alert
EquityProfitAlert(numeric), // Set Profit Target Alert
AcctNum(string), // Pass Account ID: "12345.."
oNetProfitToday(numericref); //input-output: in the strategy code you have to declare it as a variable, not as an input
Vars: BDAcctEquity(0), // Beginning Day Equity
CurAcctEquity(0), // Current Equity
AcctNetProfit(0); // Acount Net Profit
If Category{stock or futures or option...}=0 or Category=12 then begin
BDAcctEquity = GetBDAccountEquity(AcctNum); {Get Beginning of Day Account Equity}
CurAcctEquity= GetRTAccountEquity(AcctNum); {Get Real Time Account Equity}
End Else
If Category =2 then begin
BDAcctEquity = GetBDAccountNetWorth(AcctNum); {Get Beginning of Day Account NetWorth}
CurAcctEquity= GetRTAccountNetWorth(AcctNum); {Get Real Time Account NetWorth}
End;
AcctNetProfit = CurAcctEquity - BDAcctEquity;
oNetProfitToday = AcctNetProfit;
If oNetProfitToday>= EquityStopAlert and oNetProfitToday<= EquityProfitAlert then
AccountEquityStop_X=True Else AccountEquityStop_X=false;