0
关注
80
关注者
30-line gambler strategy (Selling short)
www.fmz.com
a little game strategy which can inspire you to think the trading business a different way, this short 30-line strategy is just for fun, you can test it and run it with simulation level data.
I’m hoping that the idea of this strategy can lead you to a deeper thinking of trading.
var hold = {price : 0, amount : 0}
var _Gear = 0
function main(){
var initAccount = _C(exchange.GetAccount)
Log(initAccount, "#FF0000")
while(1){
var ticker = _C(exchange.GetTicker)
if(hold.amount == 0){
var firstInfo = $.Sell(_FirstAmount)
hold.amount = firstInfo.amount
hold.price = firstInfo.price
} else {
if(ticker.Buy < hold.price - _StopWin){
var coverStopWinInfo = $.Buy(hold.amount)
hold.price = 0
hold.amount = 0
_Gear = 0
} else if(ticker.Buy > hold.price + _StopLoss && _Gear < _MaxGear){
$.Buy(hold.amount)
var amount = hold.amount * 2
var addInfo = $.Sell(amount)
hold.price = addInfo.price
hold.amount = addInfo.amount
_Gear++
}
}
LogStatus(_D(), "Number of 'Double down':", _Gear, "\n", "Current holding position:", hold)
Sleep(500)
}
}
相关推荐
调用 _C 时出错, in g__C TypeError: 'OOOOi11i1' object is not callableposition[-1].Profit 输出的盈亏和计算的盈亏不一致画图程序怎么设置显示时间可否多人异地登录?团队开发需要怎么办?Simple multi-variety commodity futures moving average line strategyOKCoin newbies HarvesterNew version of Dual Thrust Trading strategyThe new version of “the grid strategy” only contain 50-lines of coding!New version of Dynamic balanceBlockchain Quantitative Investment Series Course (3) – Calender Spread Arbitrage
评论
全部评论 (1)
- 1

