아래 4개는 제가 시뮬레이션해보는 청산식입니다.
1. 45프로 이득후 청산 또는
2. 35상승후 10프로 하락시 청산 또는
3. 6프로 하락시 청산 또는
4. 2000봉 경과시 청산
이것을 아래식으로 써주셨는데요
Var : ZPrice(0),Zhigh(0);
Var : Bidx1(0);
if MArketPosition == 1 Then
{
if CurrentContrActs > CurrentContrActs[1] And LAtestEntryNAme(0) == "Z" Then
{
ZPrice = LAtestEntryPrice(0);
Zhigh = H;
}
if Zhigh > 0 And H > Zhigh Then
Zhigh = H;
if ZPrice > 0 Then
{
ExitLong("Z1",AtLimit,ZPrice*1.45,"Z");
if Zhigh >= ZPrice*1.35 Then
ExitLong("Z2",AtStop,Zhigh*0.90,"Z");
ExitLong("Z3",AtStop,ZPrice*0.94,"Z");
}
if ZPrice > 0 Then
{
Bidx1 = Bidx1+1;
if Bidx1 == 2000 Then
ExitLong("Z4",OnClose,DEf,"Z");
}
}
Else
{
ZPrice = 0;
Zhigh = 0;
Bidx1 = 0;
}
여기서 2번 청산조건인 35상승후 10프로 하락시 청산 식을 빼고
1. 45프로 이득후 청산 또는
3. 6프로 하락시 청산 또는
4. 2000봉 경과시 청산
이렇게 3개의 조건만 사용하고싶습니다.
위의 식좀 수정부탁드립니다.
답변 1
예스스탁
예스스탁 답변
2021-08-18 13:36:31
안녕하세요
예스스탁입니다.
Var : ZPrice(0);
Var : Bidx1(0);
if MArketPosition == 1 Then
{
if CurrentContrActs > CurrentContrActs[1] And LAtestEntryNAme(0) == "Z" Then
{
ZPrice = LAtestEntryPrice(0);
}
if ZPrice > 0 Then
{
ExitLong("Z1",AtLimit,ZPrice*1.45,"Z");
ExitLong("Z3",AtStop,ZPrice*0.94,"Z");
}
if ZPrice > 0 Then
{
Bidx1 = Bidx1+1;
if Bidx1 == 2000 Then
ExitLong("Z4",OnClose,DEf,"Z");
}
}
Else
{
ZPrice = 0;
Bidx1 = 0;
}
즐거운 하루되세요
> 말라 님이 쓴 글입니다.
> 제목 : 안녕하세요 질문드립니다.
> 아래 4개는 제가 시뮬레이션해보는 청산식입니다.
1. 45프로 이득후 청산 또는
2. 35상승후 10프로 하락시 청산 또는
3. 6프로 하락시 청산 또는
4. 2000봉 경과시 청산
이것을 아래식으로 써주셨는데요
Var : ZPrice(0),Zhigh(0);
Var : Bidx1(0);
if MArketPosition == 1 Then
{
if CurrentContrActs > CurrentContrActs[1] And LAtestEntryNAme(0) == "Z" Then
{
ZPrice = LAtestEntryPrice(0);
Zhigh = H;
}
if Zhigh > 0 And H > Zhigh Then
Zhigh = H;
if ZPrice > 0 Then
{
ExitLong("Z1",AtLimit,ZPrice*1.45,"Z");
if Zhigh >= ZPrice*1.35 Then
ExitLong("Z2",AtStop,Zhigh*0.90,"Z");
ExitLong("Z3",AtStop,ZPrice*0.94,"Z");
}
if ZPrice > 0 Then
{
Bidx1 = Bidx1+1;
if Bidx1 == 2000 Then
ExitLong("Z4",OnClose,DEf,"Z");
}
}
Else
{
ZPrice = 0;
Zhigh = 0;
Bidx1 = 0;
}
여기서 2번 청산조건인 35상승후 10프로 하락시 청산 식을 빼고
1. 45프로 이득후 청산 또는
3. 6프로 하락시 청산 또는
4. 2000봉 경과시 청산
이렇게 3개의 조건만 사용하고싶습니다.
위의 식좀 수정부탁드립니다.