커뮤니티
함수 추가 부탁드립니다.
2019-06-13 19:09:23
308
글번호 129439
안녕하세요.
아래수식에 해외선물 당일 오후1시부터 다음날 오전6시까지만 매매적용 설정 부탁드립니다.
감사합니다.
Inputs: Length(10), ATRs(1.5), Pval(0.05);
Variables: KUpper(0), BuySetup(False), BuyBase(0);
KUpper = KeltnerChannel(Close, Length, ATRs);
Condition1 = Crossup(Close, KUpper);
If MarketPosition() == 1 OR Close < MA(close, Length) Then
BuySetup = False;
Else
If Condition1 Then Begin
BuySetup = True;
BuyBase = High;
End;
If BuySetup Then
Buy ("Kltr", AtStop, BuyBase + Pval);
답변 1
예스스탁 예스스탁 답변
2019-06-14 08:45:00
안녕하세요
예스스탁입니다.
Inputs: Length(10), ATRs(1.5), Pval(0.05);
input : starttime(130000),endtime(060000);
Variables: KUpper(0), BuySetup(False), BuyBase(0);
var : Tcond(false);
if (sdate != sdate[1] and stime >= starttime) or
(sdate == sdate[1] and stime >= starttime and stime[1] < starttime) then
{
Tcond = true;
}
if (sdate != sdate[1] and stime >= endtime) or
(sdate == sdate[1] and stime >= endtime and stime[1] < endtime) then
{
Tcond = false;
if MarketPosition == 1 Then
ExitLong("bx");
if MarketPosition == -1 Then
ExitShort("sx");
}
KUpper = KeltnerChannel(Close, Length, ATRs);
Condition1 = Crossup(Close, KUpper);
If MarketPosition() == 1 OR Close < MA(close, Length) Then
BuySetup = False;
Else
If Condition1 Then Begin
BuySetup = True;
BuyBase = High;
End;
If BuySetup and Tcond == true Then
Buy ("Kltr", AtStop, BuyBase + Pval);
즐거운 하루되세요
> 바둑이 님이 쓴 글입니다.
> 제목 : 함수 추가 부탁드립니다.
> 안녕하세요.
아래수식에 해외선물 당일 오후1시부터 다음날 오전6시까지만 매매적용 설정 부탁드립니다.
감사합니다.
Inputs: Length(10), ATRs(1.5), Pval(0.05);
Variables: KUpper(0), BuySetup(False), BuyBase(0);
KUpper = KeltnerChannel(Close, Length, ATRs);
Condition1 = Crossup(Close, KUpper);
If MarketPosition() == 1 OR Close < MA(close, Length) Then
BuySetup = False;
Else
If Condition1 Then Begin
BuySetup = True;
BuyBase = High;
End;
If BuySetup Then
Buy ("Kltr", AtStop, BuyBase + Pval);