3
Follow
1505
Followers
該当取引ペアのすべての先物ポジションを決済します。
決済方法:買い建てポジションの決済を例とします。売り板の最良気配値(売①)で売り注文を継続的に出し、0.5秒後に取消し、再び売①で注文を出し、完全に決済されるまで繰り返します。一度の注文量は、現在のすべての決済可能なポジションとします。
プラグインは取引ターミナルでワンクリック起動でき、無料で、手動取引を便利にします。詳細:https://www.fmz.com/digest-topic/5051
Source
JavaScript
function main(){
while(ture){
var pos = exchange.GetPosition()
var ticker = exchange.GetTicekr()
if(!ticker){return '无法获取ticker'}
if(!pos || pos.length == 0 ){return '已无持仓'}
for(var i=0;i<pos.length;i++){
if(pos[i].Type == PD_LONG){
exchange.SetContractType(pos[i].ContractType)
exchange.SetDirection('closebuy')
exchange.Sell(ticker.Buy, pos[i].Amount - pos[i].FrozenAmount)Related strategies
