답변완료
문의드립니다
1번 수식
if MarketPosition <= 0 Then
{
if 조건수식1 Then
{
if CurrentContracts < 1 Then
buy("매수1",OnClose,def,1);
}
}
if MarketPosition == 1 Then
{
if 조건수식3 Then
{
if CurrentContracts < 1 Then
buy("수1",OnClose,def,1);
}
Else
{
if 조건수식4 and CurrentContracts < 2 Then
buy("수2",OnClose,def,1);
}
}
if MarketPosition == 1 Then
{
if 조건수식1 Then
{
exitlong("청산1",OnClose,def,"매수1");
}
Else
{
if 조건수식1-2 Then
exitlong("청산1-1",OnClose,def,"매수1");
}
if 조건수식2 Then
{
exitlong("청산2",OnClose,def,"수1");
}
Else
{
if 조건수식2-1 Then
exitlong("청산2-1",OnClose,def,"수1");
}
if 조건수식4 Then
{
exitlong("청산4",OnClose,def,"수2");
}
Else
{
if 조건수식4-1 Then
exitlong("청산4-1",OnClose,def,"수2");
}
ExitLong("bp1",atlimit,AvgEntryPrice+PriceScale*익절틱수1,"매수1");
ExitLong("bl1",AtStop,AvgEntryPrice-PriceScale*손절틱수1,"매수1");
ExitLong("bp2",atlimit,AvgEntryPrice+PriceScale*익절틱수2,"수1");
ExitLong("bl2",AtStop,AvgEntryPrice-PriceScale*손절틱수2,"수1");
ExitLong("bp4",atlimit,AvgEntryPrice+PriceScale*익절틱수4,"수2");
ExitLong("bl4",AtStop,AvgEntryPrice-PriceScale*손절틱수4,"수2");
}
2번 수식
if MarketPosition <= 0 Then
{
if 조건수식1 Then
{
if CurrentContracts < 1 Then
buy("매수11",OnClose,def,1);
}
}
if MarketPosition == 1 Then
{
if 조건수식3 Then
{
if CurrentContracts < 1 Then
buy("수11",OnClose,def,1);
}
Else
{
if 조건수식4 and CurrentContracts < 2 Then
buy("수12",OnClose,def,1);
}
}
if MarketPosition == 1 Then
{
if 조건수식1 Then
{
exitlong("청산1",OnClose,def,"매수11");
}
Else
{
if 조건수식1-2 Then
exitlong("청산1-1",OnClose,def,"매수11");
}
if 조건수식2 Then
{
exitlong("청산2",OnClose,def,"수11");
}
Else
{
if 조건수식2-1 Then
exitlong("청산2-1",OnClose,def,"수11");
}
if 조건수식4 Then
{
exitlong("청산4",OnClose,def,"수12");
}
Else
{
if 조건수식4-1 Then
exitlong("청산4-1",OnClose,def,"수12");
}
ExitLong("bp1",atlimit,AvgEntryPrice+PriceScale*익절틱수1,"매수11");
ExitLong("bl1",AtStop,AvgEntryPrice-PriceScale*손절틱수1,"매수11");
ExitLong("bp2",atlimit,AvgEntryPrice+PriceScale*익절틱수2,"수11");
ExitLong("bl2",AtStop,AvgEntryPrice-PriceScale*손절틱수2,"수11");
ExitLong("bp4",atlimit,AvgEntryPrice+PriceScale*익절틱수4,"수12");
ExitLong("bl4",AtStop,AvgEntryPrice-PriceScale*손절틱수4,"수12");
}
1번 수식과 2번 수식을 1개 수식에 통합 운영하고자 할 때
즉
1번 조건만족 진입+추가진입+청산 운영
2번 조건만족 진입+추가진입+청산 운영
1번과 2번은 서로 별도로 운영하고자 할 때 수식을 어떻게 표기하나요
{
{
1번 수식
}
{
2번 수식
}
}
위와 같은 방법으로 사용할 수 있나요 어떤식으로 표기하여야 하는지 모르겠습니다.
1번 수식과 2번 수식을 이용하여 연결표기를 부탁합니다.
감사합니다.
2024-05-25
919
글번호 179966
시스템