커뮤니티
시스템수정
2017-10-31 23:59:31
162
글번호 113808
안녕하세요.
전에 질문드렸던 시스템인데요
아래 시스템에서 매도가 bx4가 되면 매수를 금지하고 싶습니다.
감사합니다.
input : 투자금(100000000);
var : LL(0),T(0),XL(0);
var : Xcond1(false),Xcond2(false),Xcond3(false),Xcond4(false);
if MarketPosition == 0 and CrossDown(c,조건a) Then
buy("b1",OnClose,def,Floor((투자금*(0.1/100))/C));
if MarketPosition == 1 Then
{
if CurrentContracts > CurrentContracts[1] Then{
T = 0;
Xcond1 = false;
Xcond2 = false;
Xcond3 = false;
Xcond4 = false;
if MaxEntries == 1 Then
LL = L;
}
if CurrentContracts < CurrentContracts[1] Then{
XL = L;
if LatestExitName(0) == "bx1" Then Xcond1 == false;
if LatestExitName(0) == "bx2" Then Xcond2 == false;
if LatestExitName(0) == "bx3" Then Xcond3 == false;
if LatestExitName(0) == "bx4" Then Xcond4 == false;
}
if L < LL Then
LL = L;
if L < XL Then
XL = L;
if CurrentContracts < CurrentContracts[1] and LatestExitName(0) == "bx2" Then
T = 1;
if CurrentContracts < CurrentContracts[1] and LatestExitName(0) == "bx3" Then
T = 2;
if T == 0 then{
if LL > EntryPrice*0.99 then
buy("b21",atlimit,EntryPrice(0)*0.99,Floor((투자금*(0.1/100))/C));
if LL > EntryPrice*0.98 then
buy("b22",atlimit,EntryPrice(0)*0.98,Floor((투자금*(0.2/100))/C));
if LL > EntryPrice*0.97 then
buy("b23",atlimit,EntryPrice(0)*0.97,Floor((투자금*(0.3/100))/C));
if LL > EntryPrice*0.96 then
buy("b24",atlimit,EntryPrice(0)*0.96,Floor((투자금*(0.4/100))/C));
if LL > EntryPrice*0.95 then
buy("b25",atlimit,EntryPrice(0)*0.95,Floor((투자금*(0.5/100))/C));
}
if T == 1 then{
if XL > LatestExitPrice(0)*0.99 then
buy("b31",atlimit,LatestExitPrice(0)*0.93,Floor((투자금*(0.1/100))/C));
if XL > LatestExitPrice(0)*0.98 then
buy("b32",atlimit,LatestExitPrice(0)*0.94,Floor((투자금*(0.2/100))/C));
if XL > LatestExitPrice(0)*0.97 then
buy("b33",atlimit,LatestExitPrice(0)*0.95,Floor((투자금*(0.3/100))/C));
if XL > LatestExitPrice(0)*0.96 then
buy("b34",atlimit,LatestExitPrice(0)*0.96,Floor((투자금*(0.4/100))/C));
if XL > LatestExitPrice(0)*0.95 then
buy("b35",atlimit,LatestExitPrice(0)*0.97,Floor((투자금*(0.5/100))/C));
}
if T == 3 then{
if XL > LatestExitPrice(0)*0.99 then
buy("b2",atlimit,LatestExitPrice(0)*0.95,Floor((투자금*(0.1/100))/C));
if XL > LatestExitPrice(0)*0.98 then
buy("b3",atlimit,LatestExitPrice(0)*0.96,Floor((투자금*(0.2/100))/C));
if XL > LatestExitPrice(0)*0.97 then
buy("b4",atlimit,LatestExitPrice(0)*0.97,Floor((투자금*(0.3/100))/C));
if XL > LatestExitPrice(0)*0.96 then
buy("b5",atlimit,LatestExitPrice(0)*0.98,Floor((투자금*(0.4/100))/C));
if XL > LatestExitPrice(0)*0.95 then
buy("b6",atlimit,LatestExitPrice(0)*0.99,Floor((투자금*(0.5/100))/C));
}
if Xcond1 == false Then
ExitLong("bx1",atlimit,AvgEntryPrice*1.05,"",Floor(CurrentContracts*0.2),2);
if Xcond2 == false Then
ExitLong("bx2",atlimit,AvgEntryPrice*1.08,"",Floor(CurrentContracts*0.5),2);
if Xcond3 == false Then
ExitLong("bx3",atlimit,AvgEntryPrice*1.10,"",Floor(CurrentContracts*0.8),2);
if Xcond4 == false Then
ExitLong("bx4",atlimit,AvgEntryPrice*1.15,"",CurrentContracts,2);
}
답변 1
예스스탁 예스스탁 답변
2017-11-01 11:48:32
안녕하세요
예스스탁입니다.
input : 투자금(100000000);
var : LL(0),T(0),XL(0);
var : Xcond1(false),Xcond2(false),Xcond3(false),Xcond4(false);
if MarketPosition == 0 and CrossDown(c,조건a) and TotalTrades == 0 Then
buy("b1",OnClose,def,Floor((투자금*(0.1/100))/C));
if MarketPosition == 1 and TotalTrades == 0 Then
{
if CurrentContracts > CurrentContracts[1] Then{
T = 0;
Xcond1 = false;
Xcond2 = false;
Xcond3 = false;
Xcond4 = false;
if MaxEntries == 1 Then
LL = L;
}
if CurrentContracts < CurrentContracts[1] Then{
XL = L;
if LatestExitName(0) == "bx1" Then Xcond1 == false;
if LatestExitName(0) == "bx2" Then Xcond2 == false;
if LatestExitName(0) == "bx3" Then Xcond3 == false;
if LatestExitName(0) == "bx4" Then Xcond4 == false;
}
if L < LL Then
LL = L;
if L < XL Then
XL = L;
if CurrentContracts < CurrentContracts[1] and LatestExitName(0) == "bx2" Then
T = 1;
if CurrentContracts < CurrentContracts[1] and LatestExitName(0) == "bx3" Then
T = 2;
if T == 0 then{
if LL > EntryPrice*0.99 then
buy("b21",atlimit,EntryPrice(0)*0.99,Floor((투자금*(0.1/100))/C));
if LL > EntryPrice*0.98 then
buy("b22",atlimit,EntryPrice(0)*0.98,Floor((투자금*(0.2/100))/C));
if LL > EntryPrice*0.97 then
buy("b23",atlimit,EntryPrice(0)*0.97,Floor((투자금*(0.3/100))/C));
if LL > EntryPrice*0.96 then
buy("b24",atlimit,EntryPrice(0)*0.96,Floor((투자금*(0.4/100))/C));
if LL > EntryPrice*0.95 then
buy("b25",atlimit,EntryPrice(0)*0.95,Floor((투자금*(0.5/100))/C));
}
if T == 1 then{
if XL > LatestExitPrice(0)*0.99 then
buy("b31",atlimit,LatestExitPrice(0)*0.93,Floor((투자금*(0.1/100))/C));
if XL > LatestExitPrice(0)*0.98 then
buy("b32",atlimit,LatestExitPrice(0)*0.94,Floor((투자금*(0.2/100))/C));
if XL > LatestExitPrice(0)*0.97 then
buy("b33",atlimit,LatestExitPrice(0)*0.95,Floor((투자금*(0.3/100))/C));
if XL > LatestExitPrice(0)*0.96 then
buy("b34",atlimit,LatestExitPrice(0)*0.96,Floor((투자금*(0.4/100))/C));
if XL > LatestExitPrice(0)*0.95 then
buy("b35",atlimit,LatestExitPrice(0)*0.97,Floor((투자금*(0.5/100))/C));
}
if T == 3 then{
if XL > LatestExitPrice(0)*0.99 then
buy("b2",atlimit,LatestExitPrice(0)*0.95,Floor((투자금*(0.1/100))/C));
if XL > LatestExitPrice(0)*0.98 then
buy("b3",atlimit,LatestExitPrice(0)*0.96,Floor((투자금*(0.2/100))/C));
if XL > LatestExitPrice(0)*0.97 then
buy("b4",atlimit,LatestExitPrice(0)*0.97,Floor((투자금*(0.3/100))/C));
if XL > LatestExitPrice(0)*0.96 then
buy("b5",atlimit,LatestExitPrice(0)*0.98,Floor((투자금*(0.4/100))/C));
if XL > LatestExitPrice(0)*0.95 then
buy("b6",atlimit,LatestExitPrice(0)*0.99,Floor((투자금*(0.5/100))/C));
}
if Xcond1 == false Then
ExitLong("bx1",atlimit,AvgEntryPrice*1.05,"",Floor(CurrentContracts*0.2),2);
if Xcond2 == false Then
ExitLong("bx2",atlimit,AvgEntryPrice*1.08,"",Floor(CurrentContracts*0.5),2);
if Xcond3 == false Then
ExitLong("bx3",atlimit,AvgEntryPrice*1.10,"",Floor(CurrentContracts*0.8),2);
if Xcond4 == false Then
ExitLong("bx4",atlimit,AvgEntryPrice*1.15,"",CurrentContracts,2);
}
즐거운 하루되세요
> 쭈니오빠 님이 쓴 글입니다.
> 제목 : 시스템수정
> 안녕하세요.
전에 질문드렸던 시스템인데요
아래 시스템에서 매도가 bx4가 되면 매수를 금지하고 싶습니다.
감사합니다.
input : 투자금(100000000);
var : LL(0),T(0),XL(0);
var : Xcond1(false),Xcond2(false),Xcond3(false),Xcond4(false);
if MarketPosition == 0 and CrossDown(c,조건a) Then
buy("b1",OnClose,def,Floor((투자금*(0.1/100))/C));
if MarketPosition == 1 Then
{
if CurrentContracts > CurrentContracts[1] Then{
T = 0;
Xcond1 = false;
Xcond2 = false;
Xcond3 = false;
Xcond4 = false;
if MaxEntries == 1 Then
LL = L;
}
if CurrentContracts < CurrentContracts[1] Then{
XL = L;
if LatestExitName(0) == "bx1" Then Xcond1 == false;
if LatestExitName(0) == "bx2" Then Xcond2 == false;
if LatestExitName(0) == "bx3" Then Xcond3 == false;
if LatestExitName(0) == "bx4" Then Xcond4 == false;
}
if L < LL Then
LL = L;
if L < XL Then
XL = L;
if CurrentContracts < CurrentContracts[1] and LatestExitName(0) == "bx2" Then
T = 1;
if CurrentContracts < CurrentContracts[1] and LatestExitName(0) == "bx3" Then
T = 2;
if T == 0 then{
if LL > EntryPrice*0.99 then
buy("b21",atlimit,EntryPrice(0)*0.99,Floor((투자금*(0.1/100))/C));
if LL > EntryPrice*0.98 then
buy("b22",atlimit,EntryPrice(0)*0.98,Floor((투자금*(0.2/100))/C));
if LL > EntryPrice*0.97 then
buy("b23",atlimit,EntryPrice(0)*0.97,Floor((투자금*(0.3/100))/C));
if LL > EntryPrice*0.96 then
buy("b24",atlimit,EntryPrice(0)*0.96,Floor((투자금*(0.4/100))/C));
if LL > EntryPrice*0.95 then
buy("b25",atlimit,EntryPrice(0)*0.95,Floor((투자금*(0.5/100))/C));
}
if T == 1 then{
if XL > LatestExitPrice(0)*0.99 then
buy("b31",atlimit,LatestExitPrice(0)*0.93,Floor((투자금*(0.1/100))/C));
if XL > LatestExitPrice(0)*0.98 then
buy("b32",atlimit,LatestExitPrice(0)*0.94,Floor((투자금*(0.2/100))/C));
if XL > LatestExitPrice(0)*0.97 then
buy("b33",atlimit,LatestExitPrice(0)*0.95,Floor((투자금*(0.3/100))/C));
if XL > LatestExitPrice(0)*0.96 then
buy("b34",atlimit,LatestExitPrice(0)*0.96,Floor((투자금*(0.4/100))/C));
if XL > LatestExitPrice(0)*0.95 then
buy("b35",atlimit,LatestExitPrice(0)*0.97,Floor((투자금*(0.5/100))/C));
}
if T == 3 then{
if XL > LatestExitPrice(0)*0.99 then
buy("b2",atlimit,LatestExitPrice(0)*0.95,Floor((투자금*(0.1/100))/C));
if XL > LatestExitPrice(0)*0.98 then
buy("b3",atlimit,LatestExitPrice(0)*0.96,Floor((투자금*(0.2/100))/C));
if XL > LatestExitPrice(0)*0.97 then
buy("b4",atlimit,LatestExitPrice(0)*0.97,Floor((투자금*(0.3/100))/C));
if XL > LatestExitPrice(0)*0.96 then
buy("b5",atlimit,LatestExitPrice(0)*0.98,Floor((투자금*(0.4/100))/C));
if XL > LatestExitPrice(0)*0.95 then
buy("b6",atlimit,LatestExitPrice(0)*0.99,Floor((투자금*(0.5/100))/C));
}
if Xcond1 == false Then
ExitLong("bx1",atlimit,AvgEntryPrice*1.05,"",Floor(CurrentContracts*0.2),2);
if Xcond2 == false Then
ExitLong("bx2",atlimit,AvgEntryPrice*1.08,"",Floor(CurrentContracts*0.5),2);
if Xcond3 == false Then
ExitLong("bx3",atlimit,AvgEntryPrice*1.10,"",Floor(CurrentContracts*0.8),2);
if Xcond4 == false Then
ExitLong("bx4",atlimit,AvgEntryPrice*1.15,"",CurrentContracts,2);
}
다음글
이전글