I have set my Binance Futures account to "One Way Only" which is equivalent to NFA compliant and set the NFA flag in Accounts.csv. My test script (see below) can open positions fine, however after the expiry of the LifeTime for the trade it can't close the position. I get the following error:
[BNBUSDT::L00004] - can't close 1@880.47 at 17:42:00
Error 075 - closing not supported (NFA?)
What am I missing here? Or is this an issue with the plugin. My test script is below
#include <profile.c>
void run()
{
set(TESTNOW|PLOTNOW|PARAMETERS|LOGFILE|NOLOCK|PRELOAD);
/// -- Optimitzation and WFO TICKS
StartDate = ifelse(Live, NOW, 20210401);
BarPeriod = 2;// 1440;
BarZone = CET;
EndDate = 20251130;
resf(BarMode, BR_WEEKEND); // allow weekend trading
LookBack=150;
//if (is(INITRUN)) Hedge = 1;
//UpdateDays = -1;
//setf(TradeMode,TR_GTC); //set orders as good-till-canceled for option spreads; TR_POS =only exit a trade if the position exists
setf(TradeMode,TR_POS);
MaxLong = MaxShort = 1;
while (asset(loop("BNBUSDT"))) //"TSLA.us", "AMZN.us", "MSFT.us", "AAPL.us" //"JPM.us", "PFE.us", "META.us", "WMT","NOW","INTC", "NVDA"
{
/// - Test that lifetime means trade is correctly closed
if (Bar - StartBar > 1 and NumOpenLong < 1) return quit("\nTEST OF BINANCE FUTURES COMPLETED");
LifeTime = 1;
if (NumOpenLong < 1 and !is(LOOKBACK)) enterLong();
}
}