커뮤니티
연속봉진입과 피라미딩nextbaropen/손절.익절.TR
2020-01-20 11:40:15
230
글번호 130689
아래 수식의
피라미딩방법(진입차수별 NextBarOpen 사용)과
청산방법(진입차수별로 각각 손절,익절,tr 사용)을 요청 수식에 적용해주십시요.
input : 연속봉(5);
input : 변동폭(0.50),수량(3);
if accumN(iff(C>O,1,0),연속봉) == 연속봉 then
buy();
if MarketPosition == 1 and MaxContracts < 수량 Then
buy("bb",AtStop,LatestEntryPrice(0)+변동폭);
.
*************************************************************************************
input : 기준(283),상승(0.10);
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 NextBarOpen < 기준+상승 and ExitDate(1) != sdate Then
buy("b1",AtStop,기준+상승);
if MarketPosition == 1 Then
{
var1 = (기준+상승) + 상승*MaxEntries;
EP[MaxEntries] = LatestEntryPrice(0);
if MaxEntries == 1 and NextBarOpen < var1 Then
buy("b2",AtStop,var1);
if MaxEntries == 2 and NextBarOpen < var1 Then
buy("b3",AtStop,var1);
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-07-29 09:50:36
안녕하세요
예스스탁입니다.
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");
}
}
즐거운 하루되세요
> 목마와숙녀 님이 쓴 글입니다.
> 제목 : 문의
> 아래 수식의
피라미딩방법(진입차수별 NextBarOpen 사용)과
청산방법(진입차수별로 각각 손절,익절,tr 사용)을 요청 수식에 적용해주십시요.
input : 연속봉(5);
input : 변동폭(0.50),수량(3);
if accumN(iff(C>O,1,0),연속봉) == 연속봉 then
buy();
if MarketPosition == 1 and MaxContracts < 수량 Then
buy("bb",AtStop,LatestEntryPrice(0)+변동폭);
.
*************************************************************************************
input : 기준(283),상승(0.10);
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 NextBarOpen < 기준+상승 and ExitDate(1) != sdate Then
buy("b1",AtStop,기준+상승);
if MarketPosition == 1 Then
{
var1 = (기준+상승) + 상승*MaxEntries;
EP[MaxEntries] = LatestEntryPrice(0);
if MaxEntries == 1 and NextBarOpen < var1 Then
buy("b2",AtStop,var1);
if MaxEntries == 2 and NextBarOpen < var1 Then
buy("b3",AtStop,var1);
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");
}
}
다음글
이전글