커뮤니티
수정부탁드립니다
2013-05-13 15:44:32
141
글번호 63142
input : T(5);
var : cnt(0),count(0);
if count == 0 Then{
if C >= dayopen+PriceScale*T or bids > asks Then
buy();
if C <= dayopen-PriceScale*T or bids < asks Then
Sell();
}
if count == 1 Then{
if MarketPosition == 0 and IsExitName("bx",1) == true and
C >= dayopen+PriceScale*T Then
buy();
if MarketPosition == 0 and IsExitName("sx",1) == true and
C <= dayopen-PriceScale*T Then
Sell();
}
if MarketPosition == 1 Then
ExitLong("bx",AtStop,dayopen-PriceScale);
if MarketPosition == -1 Then
ExitShort("sx",AtStop,dayopen+PriceScale);
당일진입 2회제한이 아닌거 같은데요;;
가격을 터치할때마다 진입이 일어나서요 수정 부탁드리겠습니다
그리고 var : cnt(0) 이것도 설명좀 부탁드릴께요 cnt(0)뜻을모르겠어요
답변 1
예스스탁 예스스탁 답변
2013-05-13 16:28:22
안녕하세요
예스스탁입니다.
수식에 당일진입횟수를 세는 부분이 빠져있었습니다.
아래식 이용하시면 됩니다.
cnt는 for문에 숫자를 받는 변수이며 count가 비교후
당일 진입횟수가 저장되는 변수입니다.
input : T(5);
var : cnt(0),count(0);
count = 0;
for cnt = 0 to 20{
if sdate == EntryDate(cnt) Then
count = count+1;
}
if count == 0 Then{
if C >= dayopen+PriceScale*T or bids > asks Then
buy();
if C <= dayopen-PriceScale*T or bids < asks Then
Sell();
}
if count == 1 Then{
if MarketPosition == 0 and IsExitName("bx",1) == true and
C >= dayopen+PriceScale*T Then
buy();
if MarketPosition == 0 and IsExitName("sx",1) == true and
C <= dayopen-PriceScale*T Then
Sell();
}
if MarketPosition == 1 Then
ExitLong("bx",AtStop,dayopen-PriceScale);
if MarketPosition == -1 Then
ExitShort("sx",AtStop,dayopen+PriceScale);
즐거운 하루되세요
> 브루스Lee 님이 쓴 글입니다.
> 제목 : 수정부탁드립니다
> input : T(5);
var : cnt(0),count(0);
if count == 0 Then{
if C >= dayopen+PriceScale*T or bids > asks Then
buy();
if C <= dayopen-PriceScale*T or bids < asks Then
Sell();
}
if count == 1 Then{
if MarketPosition == 0 and IsExitName("bx",1) == true and
C >= dayopen+PriceScale*T Then
buy();
if MarketPosition == 0 and IsExitName("sx",1) == true and
C <= dayopen-PriceScale*T Then
Sell();
}
if MarketPosition == 1 Then
ExitLong("bx",AtStop,dayopen-PriceScale);
if MarketPosition == -1 Then
ExitShort("sx",AtStop,dayopen+PriceScale);
당일진입 2회제한이 아닌거 같은데요;;
가격을 터치할때마다 진입이 일어나서요 수정 부탁드리겠습니다
그리고 var : cnt(0) 이것도 설명좀 부탁드릴께요 cnt(0)뜻을모르겠어요