0
Follow
0
Followers
Log('盈亏:', (price - last_price) * lots) # lots为下单的数量,price为开仓的价格,last_price为平仓的价格
# stocks为平仓操作后的余币,last_stocks为上一次的余币
Log('盈亏(币):', _N(stocks - last_stocks), '盈亏百分比:', _N((stocks - last_stocks) / last_stocks * 100), '%')
计算的品种是OKEX期货(BTC)。这两种盈亏一个是算钱,一个是算币,值不一样可以理解,还有换算关系在,可是几乎每次的符号都是反的,钱一直是负的(高买低卖或低卖高买了),币却一直是增长的。
这是为什么?

Related Recommendations
Great news! Check out our platforms’ NEW features, the “Demands & Offers” page on our website.Our platform’s New design PC/MacOS local software client is released now!Flash collapse robot (teaching)Index equilibrium strategy (teaching)can anyone please explain how to start with this platformC++ API call exampleHow to break through the Tick receiving limit of commodity futuresMulti-platform Hedging Stabilization Arbitrage V2.1 (Annotation Edition)Pure english vesion of e-books about some basic systematic trading skillsThe grid trading strategy
Comment
All comments (3)
- 1
