COCO研究院

 找回密碼
 註冊
搜索
查看: 2536|回復: 4

[其他程式語言] 請問大大語法,小弟一直試都有錯,請大大幫忙,感恩

[複製鏈接]
發表於 15-7-11 17:57 | 顯示全部樓層 |閱讀模式
請問大大,小弟最近試一個語法一直有錯,想請問一下

手上有多單   當第5根k棒小於第1根k棒    多單反手賣出變空單    如果沒有小於  就不動作

小弟寫的語法如下

if CurrentContracts > 0 and c > close[5]  then sell next bar  end if

但程式一直有錯,想請教大大是否那裡寫錯了,感恩

發表於 15-7-12 19:26 | 顯示全部樓層
如果是進場後第五根K棒

if MarketPosition > 0 and BrasSinceEntry = 5 and Close < Close[1] then sellshort next bat at Market ;
發表於 15-7-13 08:09 | 顯示全部樓層
if MarketPosition > 0 and BrasSinceEntry = 5 and Close < Low[5] then
sellshort next bat at Market ;
end;
發表於 15-7-13 11:59 | 顯示全部樓層
easytrader788 發表於 15-7-12 19:26
如果是進場後第五根K棒

if MarketPosition > 0 and BrasSinceEntry = 5 and Close < Close[1] then sellsh ...

如果是進場後第五根K棒

if MarketPosition > 0 and BrasSinceEntry = 5 and Close < Close[1] then sellshort next bat at Market ;


更正 if MarketPosition > 0 and BrasSinceEntry = 5 and Close < Close[5] then sellshort next bat at Market ;
 樓主| 發表於 15-7-13 22:31 | 顯示全部樓層
感恩大大,終於成功了,yaaa
您需要登錄後才可以回帖 登錄 | 註冊

本版積分規則

手機版|Archiver|站長信箱|廣告洽詢|COCO研究院

GMT+8, 24-4-28 15:19

Powered by Discuz! X3.4

Copyright © 2001-2023, Tencent Cloud.

快速回復 返回頂部 返回列表
理財討論網站 | AI繪圖AI超擬真美女AI beauty AI Stable DiffusionAI正妹AI Lookbook