Dukascopy Support Board
http://www.dukascopy.com/swiss/english/forex/jforex/forum/

如何判斷 同一方向在倉單數
http://www.dukascopy.com/swiss/english/forex/jforex/forum/viewtopic.php?f=183&t=53085
Page 1 of 1

Author:  jeffino [ Sat 29 Aug, 2015, 09:33 ]
Post subject:  如何判斷 同一方向在倉單數

你好 !
不好意思我剛接觸 VISAUALJF, 有個問題:不知道用哪個 block 去判斷BUY POSITION =0 或是 SELL POSITION =0 下才進行程式,
譬如: 程式在幫我下一張BUY POSITION 前須判斷Position 是否有BUY單, 若有則取消, 若無則下BUY單

謝謝~~

Author:  MarkLi [ Thu 22 Oct, 2015, 09:30 ]
Post subject:  Re: 如何判斷 同一方向在倉單數

您好,

如果判断Buy Position或Sell Position,先要使用Positions Viewer仓位观测器,使用All Positions,然后命名My_Positions。然后用If block比较My_Positions.Position Amount仓位数量和1,如果My_Positions.Position Amount<1,说明没有仓位,这样就可以Open at Market Buy入市开仓买多。如果My_Positions.Position Amount>=1,说明有仓位,然后用If block比较My_Positions.Position is Long=false,也就是没有多头仓位,在这个情况下Open at Market Buy入市开仓买多。请看截图。
Image

Attachments:
Capture.JPG [122.11 KiB]
Downloaded 311 times

  Page 1 of 1