Gamestudio Links
Zorro Links
Newest Posts
ZorroFix. ini /data and /log path
by jcl. 12/09/25 10:06
Zorro 2.70
by jcl. 12/09/25 10:03
Parameter selection
by jcl. 12/01/25 12:28
ZorroGPT
by TipmyPip. 11/29/25 09:38
webGL
by Ezzett. 11/27/25 23:22
Chart viewer
by clint000. 11/27/25 21:21
AUM Magazine
Latest Screens
Rocker`s Revenge
Stug 3 Stormartillery
Iljuschin 2
Galactic Strike X
Who's Online Now
1 registered members (mosfet), 8,927 guests, and 7 spiders.
Key: Admin, Global Mod, Mod
Newest Members
agasior, mosfet, MonsterX, KF_Investments, Luuk
19186 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Binance Futures - problems with closing open trades #489009
12/05/25 18:16
12/05/25 18:16
Joined: Dec 2025
Posts: 3
Essen
M
mosfet Online OP
Guest
mosfet  Online OP
Guest
M

Joined: Dec 2025
Posts: 3
Essen
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();


}
}

Re: Binance Futures - problems with closing open trades [Re: mosfet] #489010
12/06/25 12:03
12/06/25 12:03
Joined: Dec 2025
Posts: 3
Essen
M
mosfet Online OP
Guest
mosfet  Online OP
Guest
M

Joined: Dec 2025
Posts: 3
Essen
A properly formatted version of the script:

Code

#include <profile.c>


void run() 
{
	set(TESTNOW|PLOTNOW|PARAMETERS|LOGFILE|NOLOCK|PRELOAD);

	StartDate = ifelse(Live, NOW, 20210401);
	BarPeriod = 2;// 1440;
	BarZone = CET;
	EndDate = 20251130;
	resf(BarMode, BR_WEEKEND); // allow weekend trading
	LookBack=150;

	
	setf(TradeMode,TR_POS);

	MaxLong = MaxShort = 1;
	
	while (asset(loop("BNBUSDT")))   
	{		
		
		/// - 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();
	
		
	}
}


Re: Binance Futures - problems with closing open trades [Re: mosfet] #489013
Yesterday at 09:59
Yesterday at 09:59
Joined: Jul 2000
Posts: 28,038
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 28,038
Frankfurt
Listen to the error message! AFAIK Binance is a NFA broker.

Re: Binance Futures - problems with closing open trades [Re: mosfet] #489016
Yesterday at 19:09
Yesterday at 19:09
Joined: Dec 2025
Posts: 3
Essen
M
mosfet Online OP
Guest
mosfet  Online OP
Guest
M

Joined: Dec 2025
Posts: 3
Essen
That is what I thought so I set the NFA flag in Accounts.csv as the documentation states. But when the LifeTime expires and Zorro tries to close it I get the error. Setting the NFA flag explicitly in the script did not help either.

I have worked around it by entering opposite positions instead of using the exit functions and that works.

Last edited by mosfet; Yesterday at 19:09.

Moderated by  Petra 

Gamestudio download | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1