커뮤니티
함수 추가 부탁드립니다.
2019-06-11 18:05:11
319
글번호 129346
안녕하세요.
아래수식에 해외선물 당일 오후3시부터 다음날 오전5시까지만 매매적용 설정 부탁드립니다.
감사합니다.
Inputs: Strength(4);
Variables: HighPivot(0),LowPivot(0);
If SwingHigh(1, High, Strength, Strength, Strength*2+1) <> -1 Then Begin
Condition1 = True;
HighPivot = High[Strength];
End;
If MarketPosition() == 1 Then
Condition1 = False;
If Condition1 Then
Buy ("PivB", AtStop, HighPivot);
If SwingLow(1, Low, Strength, Strength, Strength*2+1) <> -1 Then Begin
Condition1 = True;
LowPivot = Low[Strength];
End;
If MarketPosition() == -1 Then
Condition1 = False;
If Condition1 Then
Sell ("PivS", AtStop, LowPivot);
SetStopProfittarget(60,PointStop);
SetStopLoss(30,PointStop);
답변 1
예스스탁 예스스탁 답변
2019-06-12 09:46:10
안녕하세요
예스스탁입니다.
input : starttime(150000),endtime(050000);
Inputs: Strength(4);
var : Tcond(false);
Variables: HighPivot(0),LowPivot(0);
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");
}
If SwingHigh(1, High, Strength, Strength, Strength*2+1) <> -1 Then Begin
Condition1 = True;
HighPivot = High[Strength];
End;
If MarketPosition() == 1 Then
Condition1 = False;
If Condition1 and Tcond == true Then
Buy ("PivB", AtStop, HighPivot);
If SwingLow(1, Low, Strength, Strength, Strength*2+1) <> -1 Then Begin
Condition1 = True;
LowPivot = Low[Strength];
End;
If MarketPosition() == -1 Then
Condition1 = False;
If Condition1 and Tcond == true Then
Sell ("PivS", AtStop, LowPivot);
SetStopProfittarget(60,PointStop);
SetStopLoss(30,PointStop);
즐거운 하루되세요
> 바둑이 님이 쓴 글입니다.
> 제목 : 함수 추가 부탁드립니다.
> 안녕하세요.
아래수식에 해외선물 당일 오후3시부터 다음날 오전5시까지만 매매적용 설정 부탁드립니다.
감사합니다.
Inputs: Strength(4);
Variables: HighPivot(0),LowPivot(0);
If SwingHigh(1, High, Strength, Strength, Strength*2+1) <> -1 Then Begin
Condition1 = True;
HighPivot = High[Strength];
End;
If MarketPosition() == 1 Then
Condition1 = False;
If Condition1 Then
Buy ("PivB", AtStop, HighPivot);
If SwingLow(1, Low, Strength, Strength, Strength*2+1) <> -1 Then Begin
Condition1 = True;
LowPivot = Low[Strength];
End;
If MarketPosition() == -1 Then
Condition1 = False;
If Condition1 Then
Sell ("PivS", AtStop, LowPivot);
SetStopProfittarget(60,PointStop);
SetStopLoss(30,PointStop);