아이스버그 위원회 전략www.fmz.com아이스버그 수수료는 투자자의 대규모 거래를 의미합니다. 시장에 과도한 영향을 피하기 위해, 큰 단일 수수료는 현재 최신 구매/판매 가격과 고객 설정 가격에 따라 자동으로 하나의 큰 주문을 여러 개의 작은 주문으로 나누고 있습니다. 전략은 자동으로 작은 주문 위임을 수행하고 이전 주문이 완전히 판매되거나 최신 가격이 현재 배치 가격에서 크게 벗어나면 자동으로 주문을 다시 배치합니다.
예를 들어: 단평균의 부동 소수점이 10로 설정되면
각 포스팅의 수는 단일 포스팅의 평균 가치의 90%~110%이며, 포스팅 가격은 마지막 구매 가격이라고 합시다 1 번 (제곱 1 위임 깊이), 그리고 새로운 포스팅은 마지막 포스팅이 완료 된 후에 이루어집니다. 자동으로 주문을 철회하고 최신 거래 가격이 포스팅 깊이 * 2보다 높을 때 다시 포스팅합니다.
전략의 총 규모가 전체 주문 수와 같을 때 포스팅이 중단됩니다. 시장의 최신 거래 가격이 최대 구매 가격보다 높을 때 수수료는 중단되고, 최신 거래 가격이 가장 높은 구매 가격보다 낮으면 수수료는 재개됩니다.
function CancelPendingOrders() {
while (true) {
var orders = _C(exchange.GetOrders);
if (orders.length == 0) {
return;
}
for (var j = 0; j < orders.length; j++) {
exchange.CancelOrder(orders[j].Id);
if (j < (orders.length-1)) {
Sleep(Interval);
}
}
}
}
var LastBuyPrice = 0;
var InitAccount = null;
function dispatch() {
var account = null;
var ticker = _C(exchange.GetTicker);
if (LastBuyPrice > 0) {
if (_C(exchange.GetOrders).length > 0) {
if (ticker.Last > LastBuyPrice && ((ticker.Last - LastBuyPrice) / LastBuyPrice) > (2*(EntrustDepth/100))) {
Log('deviate to much, newest last price:', ticker.Last, 'order buy price', LastBuyPrice);
CancelPendingOrders();
} else {
return true;
}
} else {
account = _C(exchange.GetAccount);
Log("order finised, total cost:", _N(InitAccount.Balance - account.Balance), "avg buy price:", _N((InitAccount.Balance - account.Balance) / (account.Stocks - InitAccount.Stocks)));
}
LastBuyPrice = 0;
}
var BuyPrice = _N(ticker.Buy * (1 - EntrustDepth/100),PricePerision);
if (BuyPrice > MaxBuyPrice) {
return true;
}
if (!account) {
account = _C(exchange.GetAccount);
}
if ((InitAccount.Balance - account.Balance) >= TotalBuyNet) {
return false;
}
var RandomAvgBuyOnce = (AvgBuyOnce * ((100 - FloatPoint) / 100)) + (((FloatPoint * 2) / 100) * AvgBuyOnce * Math.random());
var UsedMoney = Math.min(account.Balance, RandomAvgBuyOnce, TotalBuyNet - (InitAccount.Balance - account.Balance));
var BuyAmount = _N(UsedMoney / BuyPrice, 3);
if (BuyAmount < MinStock) {
return false;
}
LastBuyPrice = BuyPrice;
exchange.Buy(BuyPrice, BuyAmount, 'Cost: ', _N(UsedMoney), 'last price', ticker.Last);
return true;
}
function main() {
CancelPendingOrders();
InitAccount = _C(exchange.GetAccount);
Log(InitAccount);
if (InitAccount.Balance < TotalBuyNet) {
throw "balance not enough";
}
LoopInterval = Math.max(LoopInterval, 1);
while (dispatch()) {
Sleep(LoopInterval * 1000);
}
Log("All Done", _C(exchange.GetAccount));
}
작은 꿈멋지네요