예스스탁
예스스탁 답변
2023-09-01 10:56:35
안녕하세요
예스스탁입니다.
1
Inputs: PercentRLen(10), OverSold(10), OverBought(90), Trigger(62);
Variables: PcntR(0), AvgValue(0), Setup1(False), Setup2(False);
PcntR = PercentR(PercentRLen);
AvgValue = MA(Close, PercentRLen);
If PcntR < OverSold Then
Setup1 = True;
If PcntR > OverBought Then
Setup1 = False;
If PcntR > OverBought Then
Setup2 = True;
If PcntR < OverSold Then
Setup2 = False;
var1 = ma(C,40);
If Setup1 AND AvgValue > AvgValue[1] AND Crossup(PcntR,Trigger) Then
Begin
Setup1 = False;
if C >=var1 Then
Buy ("%R_LE");
Else
Sell("bs");
End;
If Setup2 AND AvgValue < AvgValue[1] AND CrossDown(PcntR, Trigger) Then Begin
Setup2 = False;
ExitLong ("%R_SE");
End;
2
Inputs: PercentRLen(10), OverSold(10), OverBought(90), Trigger(62);
Variables: PcntR(0), AvgValue(0), Setup1(False), Setup2(False);
PcntR = PercentR(PercentRLen);
AvgValue = MA(Close, PercentRLen);
If PcntR < OverSold Then
Setup1 = True;
If PcntR > OverBought Then
Setup1 = False;
If PcntR > OverBought Then
Setup2 = True;
If PcntR < OverSold Then
Setup2 = False;
var1 = ma(C,40);
If Setup1 AND AvgValue > AvgValue[1] AND Crossup(PcntR,Trigger) Then Begin
Setup1 = False;
ExitShort ("%R_LE");
End;
If Setup2 AND AvgValue < AvgValue[1] AND CrossDown(PcntR, Trigger) Then
Begin
Setup2 = False;
if c <= var1 Then
Sell ("%R_SE");
Else
Buy("sb");
End;
3
input : StartTime(160000),EndTime(50000),진입횟수(10);
input : 익절틱수(400),손절틱수(50);
Inputs: Length1(15), Pval1(0.05);
Inputs: Length2(10), Pval2(0.07);
var : Tcond(False),entry(0);
Variables: Mom1(0),Mom2(0);
IF Endtime > starttime Then
SetStopEndofday(Endtime);
Else
{
if sDate != sDate[1] Then
SetStopEndofday(Endtime);
}
if (sdate != sdate[1] and stime >= StartTime) or
(sdate == sdate[1] and stime >= StartTime and stime[1] < StartTime) Then
{
Tcond = true;
entry = 0;
IF Endtime <= starttime Then
{
SetStopEndofday(0);
}
}
if (sdate != sdate[1] and stime >= EndTime) or
(sdate == sdate[1] and stime >= EndTime and stime[1] < EndTime) Then
{
Tcond = False;
}
if (MarketPosition != 0 and MarketPosition != MarketPosition[1]) or
(MarketPosition == MarketPosition[1] and TotalTrades > TotalTrades[1]) Then
entry = entry+1;
Mom1 = C- C[Length1];
Mom2 = C- C[Length2];
if Tcond == true and entry < 진입횟수 Then
{
If Mom1 > 0 AND Mom1 >= Mom1[1] AND MarketPosition() <> 1 Then
Buy ("Mom_LE", AtStop, High + Pval1);
If Mom1 < 0 AND Mom1 <= Mom1[1] AND MarketPosition() <> -1 Then
ExitLong ("Mom_BX", AtStop, Low - Pval1);
If Mom2 > 0 AND Mom2 >= Mom2[1] AND MarketPosition() <> 1 Then
ExitShort ("Mom_SX", AtStop, High + Pval2);
If Mom2 < 0 AND Mom2 <= Mom2[1] AND MarketPosition() <> -1 Then
Sell ("Mom_SE", AtStop, Low - Pval2);
}
SetStopProfittarget(PriceScale*익절틱수,PointStop);
SetStopLoss(PriceScale*손절틱수,PointStop);
즐거운 하루되세요
> 푸른 님이 쓴 글입니다.
> 제목 : 문의 드립니다
> 1.
Inputs: PercentRLen(10), OverSold(10), OverBought(90), Trigger(62);
Variables: PcntR(0), AvgValue(0), Setup1(False), Setup2(False);
PcntR = PercentR(PercentRLen);
AvgValue = MA(Close, PercentRLen);
If PcntR < OverSold Then
Setup1 = True;
If PcntR > OverBought Then
Setup1 = False;
If PcntR > OverBought Then
Setup2 = True;
If PcntR < OverSold Then
Setup2 = False;
If Setup1 AND AvgValue > AvgValue[1] AND Crossup(PcntR,Trigger) Then Begin
Setup1 = False;
Buy ("%R_LE");
End;
If Setup2 AND AvgValue < AvgValue[1] AND CrossDown(PcntR, Trigger) Then Begin
Setup2 = False;
ExitLong ("%R_SE");
End;
2.
Inputs: PercentRLen(10), OverSold(10), OverBought(90), Trigger(62);
Variables: PcntR(0), AvgValue(0), Setup1(False), Setup2(False);
PcntR = PercentR(PercentRLen);
AvgValue = MA(Close, PercentRLen);
If PcntR < OverSold Then
Setup1 = True;
If PcntR > OverBought Then
Setup1 = False;
If PcntR > OverBought Then
Setup2 = True;
If PcntR < OverSold Then
Setup2 = False;
If Setup1 AND AvgValue > AvgValue[1] AND Crossup(PcntR,Trigger) Then Begin
Setup1 = False;
ExitShort ("%R_LE");
End;
If Setup2 AND AvgValue < AvgValue[1] AND CrossDown(PcntR, Trigger) Then Begin
Setup2 = False;
Sell ("%R_SE");
End;
------------------
1번 수식어에서 40선 아래에서 매수는 매도 전환
2번 수식어에서 40선 위에서 매도신호는 매수전환의
추가 수식어를 부탁합니다.
3.
input : StartTime(160000),EndTime(50000),진입횟수(10);
input : 익절틱수(400),손절틱수(50);
Inputs: Length(15), Pval(0.05);
var : Tcond(False),entry(0);
Variables: Mom(0);
IF Endtime > starttime Then
SetStopEndofday(Endtime);
Else
{
if sDate != sDate[1] Then
SetStopEndofday(Endtime);
}
if (sdate != sdate[1] and stime >= StartTime) or
(sdate == sdate[1] and stime >= StartTime and stime[1] < StartTime) Then
{
Tcond = true;
entry = 0;
IF Endtime <= starttime Then
{
SetStopEndofday(0);
}
}
if (sdate != sdate[1] and stime >= EndTime) or
(sdate == sdate[1] and stime >= EndTime and stime[1] < EndTime) Then
{
Tcond = False;
}
if (MarketPosition != 0 and MarketPosition != MarketPosition[1]) or
(MarketPosition == MarketPosition[1] and TotalTrades > TotalTrades[1]) Then
entry = entry+1;
Mom = C- C[Length];
if Tcond == true and entry < 진입횟수 Then
{
If Mom > 0 AND Mom >= Mom[1] AND MarketPosition() <> 1 Then
Buy ("Mom_LE", AtStop, High + Pval);
If Mom < 0 AND Mom <= Mom[1] AND MarketPosition() <> -1 Then
ExitLong ("Mom_SE", AtStop, Low - Pval);
}
SetStopProfittarget(PriceScale*익절틱수,PointStop);
SetStopLoss(PriceScale*손절틱수,PointStop);
4.
input : StartTime(160000),EndTime(50000),진입횟수(10);
input : 익절틱수(400),손절틱수(50);
Inputs: Length(10), Pval(0.05);
var : Tcond(False),entry(0);
Variables: Mom(0);
IF Endtime > starttime Then
SetStopEndofday(Endtime);
Else
{
if sDate != sDate[1] Then
SetStopEndofday(Endtime);
}
if (sdate != sdate[1] and stime >= StartTime) or
(sdate == sdate[1] and stime >= StartTime and stime[1] < StartTime) Then
{
Tcond = true;
entry = 0;
IF Endtime <= starttime Then
{
SetStopEndofday(0);
}
}
if (sdate != sdate[1] and stime >= EndTime) or
(sdate == sdate[1] and stime >= EndTime and stime[1] < EndTime) Then
{
Tcond = False;
}
if (MarketPosition != 0 and MarketPosition != MarketPosition[1]) or
(MarketPosition == MarketPosition[1] and TotalTrades > TotalTrades[1]) Then
entry = entry+1;
Mom = C- C[Length];
if Tcond == true and entry < 진입횟수 Then
{
If Mom > 0 AND Mom >= Mom[1] AND MarketPosition() <> 1 Then
ExitShort ("Mom_LE", AtStop, High + Pval);
If Mom < 0 AND Mom <= Mom[1] AND MarketPosition() <> -1 Then
Sell ("Mom_SE", AtStop, Low - Pval);
}
SetStopProfittarget(PriceScale*익절틱수,PointStop);
SetStopLoss(PriceScale*손절틱수,PointStop);
---------------------------
3번 수식어의 Inputs: Length(15), Pval(0.05);
4번 수식어의 Inputs: Length(10), Pval(0.05);
둘을 단일 수식어에 묶어서
3번은 Inputs: Length(15), Pval(0.05);
4번은 Inputs: Length(10), Pval(0.07);
변경해서 수식어 작성을 하고 싶습니다.
늘 감사드립니다.