커뮤니티
수식 검토 부탁드립니다.
항상 많은 도움 감사드립니다. 시스템식 중에서 포지션 정리 부분에서 stoploss가 생각하고는 다르게 작동하는 경우가 있어서 잘못된 부분에 대해서 검토 부탁드립니다.
if MarketPosition == 1 Then
{
if IsEntryName("A매수") == true Then
SetStopLoss(8,PointStop);
if IsEntryName("B매수") == true Then
SetStopLoss(10,PointStop);
if IsEntryName("C매수") == true Then
SetStopLoss(15,PointStop);
}
Else
SetStopLoss(0);
if MarketPosition == 1 Then
{
if IsEntryName("A매수") == true Then
{
if CrossDown(A,B)
then
Exitlong("매수정리1",atmarket,def,"A매수");
}
if IsEntryName("B매수") == true Then
{
if CrossDown(C,D)
then
Exitlong("매수정리2",atmarket,def,"B매수");
}
if IsEntryName("C매수") == true Then
{
if CrossDown(E,F)
then
Exitlong("매수정리3",atmarket,def,"C매수");
}
}
if MarketPosition == -1 Then
{
if IsEntryName("AI매도") == true Then
SetStopLoss(8,PointStop);
if IsEntryName("B매도") == true Then
SetStopLoss(10,PointStop);
if IsEntryName("C매도") == true Then
SetStopLoss(15,PointStop);
}
Else
SetStopLoss(0);
if MarketPosition ==- 1 Then
{
if IsEntryName("A매도") == true Then
{
if CrossUp(A,B)
then
Exitshort("매도정리1",atmarket,def,"A매도");
}
if IsEntryName("B매도") == true Then
{
if CrossUp(C,D)
then
Exitshort("매도정리2",atmarket,def,"B매도");
}
if IsEntryName("C매도") == true Then
{
if CrossUp(E,F)
then
Exitshort("매도정리3",atmarket,def,"C매도");
}
}
이런식으로 작성하면 매수쪽에 stoploss 값은 맞게 포지션 정리가 되는데 매도쪽 stoploss가 정해놓은것과 다른 값에 정리가 되는 경우가 있어서요..검토 및 수식 수정 부탁드리겠습니다. 핵심은 매수와 매도 포지션 정리할때 각각 종류의 매수,매도 포지션에 다른 stoploss값을 주려는 것입니다.
답변 1
예스스탁 예스스탁 답변
2025-11-11 13:02:09