커뮤니티
피라미딩 검증구간
2019-11-01 10:36:25
258
글번호 131147
아래수식은 첫번째 진입이후 변동폭이 0.50씩 상승할 때 마다 피라미딩이 되는데
첫번째 진입이후 1.00포인트 상승 이후부터 변동폭대로 피라미딩하고 싶습니다.
input : 추세확인구간(1.00),변동폭(0.50),수량(3);
항상 고맙습니다.
*********************************************************************************
input : 연속봉(5);
input : 변동폭(0.50),수량(3);
input : 손절1(50),익절1(300),TR1(150);
input : 손절2(50),익절2(300),TR2(150);
input : 손절3(50),익절3(300),TR3(150);
Array : EP[30](0);
if MarketPosition == 0 and accumN(iff(C>O,1,0),연속봉) == 연속봉 and ExitDate(1) != sdate then
buy("b1");
if MarketPosition == 1 Then
{
EP[MaxEntries] = LatestEntryPrice(0);
if MaxEntries == 1 and MaxContracts < 수량 and NextBarOpen < LatestEntryPrice(0)+변동폭 Then
buy("b2",AtStop,LatestEntryPrice(0)+변동폭);
if MaxEntries == 2 and MaxContracts < 수량 and NextBarOpen < LatestEntryPrice(0)+변동폭 Then
buy("b3",AtStop,LatestEntryPrice(0)+변동폭);
if MaxEntries >= 1 and EP[1] > 0 Then
{
ExitLong("bl1",AtStop,EP[1]-PriceScale*손절1,"b1");
ExitLong("bp1",Atlimit,EP[1]+PriceScale*익절1,"b1");
ExitLong("btr1",AtStop,highest(h,BarsSinceEntry)-PriceScale*TR1,"b1");
}
if MaxEntries >= 2 and EP[2] > 0 Then
{
ExitLong("bl2",AtStop,EP[2]-PriceScale*손절2,"b2");
ExitLong("bp2",Atlimit,EP[2]+PriceScale*익절2,"b2");
ExitLong("btr2",AtStop,highest(h,BarsSinceEntry)-PriceScale*TR2,"b2");
}
if MaxEntries >= 3 and EP[3] > 0 Then
{
ExitLong("bl3",AtStop,EP[3]-PriceScale*손절3,"b3");
ExitLong("bp3",Atlimit,EP[3]+PriceScale*익절3,"b3");
ExitLong("btr3",AtStop,highest(h,BarsSinceEntry)-PriceScale*TR3,"b3");
}
}
답변 1
예스스탁 예스스탁 답변
2019-08-14 11:44:58
안녕하세요
예스스탁입니다.
input : 연속봉(5);
input : 추세확인구간(1.00),변동폭(0.50),수량(3);
input : 손절1(50),익절1(300),TR1(150);
input : 손절2(50),익절2(300),TR2(150);
input : 손절3(50),익절3(300),TR3(150);
Array : EP[30](0);
if MarketPosition == 0 and accumN(iff(C>O,1,0),연속봉) == 연속봉 and ExitDate(1) != sdate then
buy("b1");
if MarketPosition == 1 Then
{
EP[MaxEntries] = LatestEntryPrice(0);
if MaxEntries == 1 and MaxContracts < 수량 and NextBarOpen < LatestEntryPrice(0)+변동폭+추세확인구간 Then
buy("b2",AtStop,LatestEntryPrice(0)+변동폭+추세확인구간);
if MaxEntries == 2 and MaxContracts < 수량 and NextBarOpen < LatestEntryPrice(0)+변동폭+추세확인구간 Then
buy("b3",AtStop,LatestEntryPrice(0)+변동폭+추세확인구간);
if MaxEntries >= 1 and EP[1] > 0 Then
{
ExitLong("bl1",AtStop,EP[1]-PriceScale*손절1,"b1");
ExitLong("bp1",Atlimit,EP[1]+PriceScale*익절1,"b1");
ExitLong("btr1",AtStop,highest(h,BarsSinceEntry)-PriceScale*TR1,"b1");
}
if MaxEntries >= 2 and EP[2] > 0 Then
{
ExitLong("bl2",AtStop,EP[2]-PriceScale*손절2,"b2");
ExitLong("bp2",Atlimit,EP[2]+PriceScale*익절2,"b2");
ExitLong("btr2",AtStop,highest(h,BarsSinceEntry)-PriceScale*TR2,"b2");
}
if MaxEntries >= 3 and EP[3] > 0 Then
{
ExitLong("bl3",AtStop,EP[3]-PriceScale*손절3,"b3");
ExitLong("bp3",Atlimit,EP[3]+PriceScale*익절3,"b3");
ExitLong("btr3",AtStop,highest(h,BarsSinceEntry)-PriceScale*TR3,"b3");
}
}
즐거운 하루되세요
> 목마와숙녀 님이 쓴 글입니다.
> 제목 : 문의
> 아래수식은 첫번째 진입이후 변동폭이 0.50씩 상승할 때 마다 피라미딩이 되는데
첫번째 진입이후 1.00포인트 상승 이후부터 변동폭대로 피라미딩하고 싶습니다.
input : 추세확인구간(1.00),변동폭(0.50),수량(3);
항상 고맙습니다.
*********************************************************************************
input : 연속봉(5);
input : 변동폭(0.50),수량(3);
input : 손절1(50),익절1(300),TR1(150);
input : 손절2(50),익절2(300),TR2(150);
input : 손절3(50),익절3(300),TR3(150);
Array : EP[30](0);
if MarketPosition == 0 and accumN(iff(C>O,1,0),연속봉) == 연속봉 and ExitDate(1) != sdate then
buy("b1");
if MarketPosition == 1 Then
{
EP[MaxEntries] = LatestEntryPrice(0);
if MaxEntries == 1 and MaxContracts < 수량 and NextBarOpen < LatestEntryPrice(0)+변동폭 Then
buy("b2",AtStop,LatestEntryPrice(0)+변동폭);
if MaxEntries == 2 and MaxContracts < 수량 and NextBarOpen < LatestEntryPrice(0)+변동폭 Then
buy("b3",AtStop,LatestEntryPrice(0)+변동폭);
if MaxEntries >= 1 and EP[1] > 0 Then
{
ExitLong("bl1",AtStop,EP[1]-PriceScale*손절1,"b1");
ExitLong("bp1",Atlimit,EP[1]+PriceScale*익절1,"b1");
ExitLong("btr1",AtStop,highest(h,BarsSinceEntry)-PriceScale*TR1,"b1");
}
if MaxEntries >= 2 and EP[2] > 0 Then
{
ExitLong("bl2",AtStop,EP[2]-PriceScale*손절2,"b2");
ExitLong("bp2",Atlimit,EP[2]+PriceScale*익절2,"b2");
ExitLong("btr2",AtStop,highest(h,BarsSinceEntry)-PriceScale*TR2,"b2");
}
if MaxEntries >= 3 and EP[3] > 0 Then
{
ExitLong("bl3",AtStop,EP[3]-PriceScale*손절3,"b3");
ExitLong("bp3",Atlimit,EP[3]+PriceScale*익절3,"b3");
ExitLong("btr3",AtStop,highest(h,BarsSinceEntry)-PriceScale*TR3,"b3");
}
}
다음글
이전글