請選擇 進入手機版 | 繼續訪問電腦版

COCO研究院

 找回密碼
 註冊
搜索
查看: 16824|回復: 0

語法請教

[複製鏈接]
發表於 21-3-5 21:27 | 顯示全部樓層 |閱讀模式
功力不足,寫出來的東西很怪,可以告訴我哪裡寫錯嗎?或怎麼寫會比較恰當?
像我的inputs:len(N),N用2、3、4、....20,交易總次數都是2197次,怪怪的....

想法:當收盤價來到N根內最高點時,下一根K棒市價進場,進場後3根內結束本次操作,進場時間09:00~13:00以及16:00~隔天04:00,設定時間強制平倉,賺20點停利、賠20點停利。

inputs:len(N);
vars:HH(0);

SetStopLoss(BigPointValue*20);   
SetProfitTarget(BigPointValue*20);
if barssinceentry=3 then begin
sell next bar at market;
buytocover next bar at market;
end;

if marketposition<>0 and time=1340 then begin
sell next bar at market;
buytocover next bar at market;
end;
if marketposition<>0 and time=0440 then begin
sell next bar at market;
buytocover next bar at market;
end;

HH=highest(high,len);

condition1=Close cross over HH;
condition2=time>=0900 and time<=1300;
condition3=time>=1600 or time<=0400;
condition4=marketposition<1;

if condition1 and condition2 and condition3 and condition4
then buy next bar at market;

您需要登錄後才可以回帖 登錄 | 註冊

本版積分規則

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

GMT+8, 24-3-29 06:38

Powered by Discuz! X3.4

Copyright © 2001-2023, Tencent Cloud.

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