커뮤니티
문의 드립니다
2016-10-27 12:47:17
96
글번호 103427
청산부분을 사용중인 것으로 해보니 잘 않되어 문의 드립니다.
집입수량 만큼 청산이 되도록 부탁 드립니다.
감사합니다
input : n(10),aa(1);
if dayhigh >= dayopen+PriceScale*n and stime < 113000 Then{
if L > dayopen+PriceScale*1 Then
buy("b1",atlimit,dayopen+PriceScale*1,aa);
if L > dayopen+PriceScale*2 Then
buy("b2",atlimit,dayopen+PriceScale*2,aa);
if L > dayopen+PriceScale*3 Then
buy("b3",atlimit,dayopen+PriceScale*3,aa);
}
if MarketPosition == 1 and C < dayopen Then
ExitLong("bx");
if MarketPosition == 1 Then{
ExitLong("BP1",atlimit,EntryPrice+PriceScale*10,"",max(1,Floor(MaxContracts*0.35)),1);
ExitLong("BP2",atlimit,EntryPrice+PriceScale*20,"",max(1,Floor(MaxContracts*0.35)),1);
ExitLong("BP3",atlimit,EntryPrice+PriceScale*30,"",max(1,Floor(MaxContracts*0.2)),1);
ExitLong("BP4",atlimit,EntryPrice+PriceScale*40,"",max(1,Floor(MaxContracts*0.05)),1);
ExitLong("BP5",atlimit,EntryPrice+PriceScale*50);
if highest(H,BarsSinceEntry) >= EntryPrice+PriceScale*10 Then
ExitLong("Ts",AtStop,highest(H,BarsSinceEntry)-(highest(H,BarsSinceEntry)-EntryPrice)*1);
}
답변 1
예스스탁 예스스탁 답변
2016-10-27 14:09:04
안녕하세요
예스스탁입니다.
문의하신 내용 어느부분을 수정해 드려야 할지 모르겠습니다.
해당식의 청산은
종가가 시가보다 작으면 전량청산
10틱 수익이면 보유수량의 35% 청산
20틱 수익이면 보유수량의 35% 청산
30틱 수익이면 보유수량의 20% 청산
40틱 수익이면 보유수량의 5% 청산
50틱 수익이면 남은수량 전량 청산
10틱 이상 수익후 최고가에서 진입가까지 하락하면 전량 청산입니다.
진입이 피라미딩이면 하나의 청산이 진입횟수만큼 발생할수 있으므로
각 청산이 진입중 한번만 발생하게 수정해 드립니다.
input : n(10),aa(1);
if dayhigh >= dayopen+PriceScale*n and stime < 113000 Then{
if L > dayopen+PriceScale*1 Then
buy("b1",atlimit,dayopen+PriceScale*1,aa);
if L > dayopen+PriceScale*2 Then
buy("b2",atlimit,dayopen+PriceScale*2,aa);
if L > dayopen+PriceScale*3 Then
buy("b3",atlimit,dayopen+PriceScale*3,aa);
}
if MarketPosition == 1 then{
if C < dayopen Then
ExitLong("bx");
if CurrentContracts < CurrentContracts[1] and LatestExitName(0) == "BP1" Then
Condition1 = true;
if CurrentContracts < CurrentContracts[1] and LatestExitName(0) == "BP2" Then
Condition2 = true;
if CurrentContracts < CurrentContracts[1] and LatestExitName(0) == "BP3" Then
Condition3 = true;
if CurrentContracts < CurrentContracts[1] and LatestExitName(0) == "BP4" Then
Condition4 = true;
if CurrentContracts < CurrentContracts[1] and LatestExitName(0) == "BP5" Then
Condition5 = true;
if Condition1 == false then
ExitLong("BP1",atlimit,EntryPrice+PriceScale*10,"",max(1,Floor(MaxContracts*0.35)),1);
if Condition2 == false then
ExitLong("BP2",atlimit,EntryPrice+PriceScale*20,"",max(1,Floor(MaxContracts*0.35)),1);
if Condition3 == false then
ExitLong("BP3",atlimit,EntryPrice+PriceScale*30,"",max(1,Floor(MaxContracts*0.2)),1);
if Condition4 == false then
ExitLong("BP4",atlimit,EntryPrice+PriceScale*40,"",max(1,Floor(MaxContracts*0.05)),1);
if Condition5 == false then
ExitLong("BP5",atlimit,EntryPrice+PriceScale*50);
if highest(H,BarsSinceEntry) >= EntryPrice+PriceScale*10 Then
ExitLong("Ts",AtStop,highest(H,BarsSinceEntry)-(highest(H,BarsSinceEntry)-EntryPrice)*1);
}
else{
Condition1 = false;
Condition2 = false;
Condition3 = false;
Condition4 = false;
Condition5 = false;
}
즐거운 하루되세요
> epn 님이 쓴 글입니다.
> 제목 : 문의 드립니다
> 청산부분을 사용중인 것으로 해보니 잘 않되어 문의 드립니다.
집입수량 만큼 청산이 되도록 부탁 드립니다.
감사합니다
input : n(10),aa(1);
if dayhigh >= dayopen+PriceScale*n and stime < 113000 Then{
if L > dayopen+PriceScale*1 Then
buy("b1",atlimit,dayopen+PriceScale*1,aa);
if L > dayopen+PriceScale*2 Then
buy("b2",atlimit,dayopen+PriceScale*2,aa);
if L > dayopen+PriceScale*3 Then
buy("b3",atlimit,dayopen+PriceScale*3,aa);
}
if MarketPosition == 1 and C < dayopen Then
ExitLong("bx");
if MarketPosition == 1 Then{
ExitLong("BP1",atlimit,EntryPrice+PriceScale*10,"",max(1,Floor(MaxContracts*0.35)),1);
ExitLong("BP2",atlimit,EntryPrice+PriceScale*20,"",max(1,Floor(MaxContracts*0.35)),1);
ExitLong("BP3",atlimit,EntryPrice+PriceScale*30,"",max(1,Floor(MaxContracts*0.2)),1);
ExitLong("BP4",atlimit,EntryPrice+PriceScale*40,"",max(1,Floor(MaxContracts*0.05)),1);
ExitLong("BP5",atlimit,EntryPrice+PriceScale*50);
if highest(H,BarsSinceEntry) >= EntryPrice+PriceScale*10 Then
ExitLong("Ts",AtStop,highest(H,BarsSinceEntry)-(highest(H,BarsSinceEntry)-EntryPrice)*1);
}