커뮤니티
line 보조데이타 수식
2019-11-01 10:24:15
208
글번호 131814
보조data 이용 수식으로 변경바랍니다.
항상 고맙습니다.
**************************************************************************************
input : 기준(265),진폭(0.50);
input : 검증1(1.00),검증2(0.8),검증3(0.60),변동폭(0.10),수량(7);
input : 손절1(50),익절1(300),TR1(150);
input : 손절2(50),익절2(300),TR2(150);
input : 손절3(50),익절3(300),TR3(150);
input : 손절4(50),익절4(300),TR4(150);
input : 손절5(50),익절5(300),TR5(150);
input : 손절6(50),익절6(300),TR6(150);
input : 손절7(50),익절7(300),TR7(150);
Array : EP[30](0);
if MarketPosition == 0 and NextBarOpen < 기준+진폭 and ExitDate(1) != sdate Then
buy("b1",AtStop,기준+진폭);
if MarketPosition == 1 Then
{
EP[MaxEntries] = LatestEntryPrice(0);
if MaxEntries == 1 and MaxContracts < 수량 and NextBarOpen < LatestEntryPrice(0)+검증1 Then
buy("b2",AtStop,LatestEntryPrice(0)+검증1);
if MaxEntries == 2 and MaxContracts < 수량 and NextBarOpen < LatestEntryPrice(0)+검증2 Then
buy("b3",AtStop,LatestEntryPrice(0)+검증2);
if MaxEntries == 3 and MaxContracts < 수량 and NextBarOpen < LatestEntryPrice(0)+검증3 Then
buy("b4",AtStop,LatestEntryPrice(0)+검증3);
if MaxEntries == 4 and MaxContracts < 수량 and NextBarOpen < LatestEntryPrice(0)+변동폭 Then
buy("b5",AtStop,LatestEntryPrice(0)+변동폭);
if MaxEntries == 5 and MaxContracts < 수량 and NextBarOpen < LatestEntryPrice(0)+변동폭 Then
buy("b6",AtStop,LatestEntryPrice(0)+변동폭);
if MaxEntries == 6 and MaxContracts < 수량 and NextBarOpen < LatestEntryPrice(0)+변동폭 Then
buy("b7",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");
}
if MaxEntries >= 4 and EP[4] > 0 Then
{
ExitLong("bl4",AtStop,EP[4]-PriceScale*손절4,"b4");
ExitLong("bp4",Atlimit,EP[4]+PriceScale*익절4,"b4");
ExitLong("btr4",AtStop,highest(h,BarsSinceEntry)-PriceScale*TR4,"b4");
}
if MaxEntries >= 5 and EP[5] > 0 Then
{
ExitLong("bl5",AtStop,EP[5]-PriceScale*손절5,"b5");
ExitLong("bp5",Atlimit,EP[5]+PriceScale*익절5,"b5");
ExitLong("btr5",AtStop,highest(h,BarsSinceEntry)-PriceScale*TR5,"b5");
}
if MaxEntries >= 6 and EP[6] > 0 Then
{
ExitLong("bl6",AtStop,EP[6]-PriceScale*손절6,"b6");
ExitLong("bp6",Atlimit,EP[6]+PriceScale*익절6,"b6");
ExitLong("btr6",AtStop,highest(h,BarsSinceEntry)-PriceScale*TR6,"b6");
}
if MaxEntries >= 7 and EP[7] > 0 Then
{
ExitLong("bl7",AtStop,EP[7]-PriceScale*손절7,"b7");
ExitLong("bp7",Atlimit,EP[7]+PriceScale*익절7,"b7");
ExitLong("btr7",AtStop,highest(h,BarsSinceEntry)-PriceScale*TR7,"b7");
}
}
답변 1
예스스탁 예스스탁 답변
2019-09-09 13:26:25
안녕하세요
예스스탁입니다.
참조데이타를 이용한 수식은 봉완성시로만 가능합니다.
모든 atstop,atlimit 신호는 봉완성시 종가기준으로 변경해 작성해 드립니다.
input : 기준(265),진폭(0.50);
input : 검증1(1.00),검증2(0.8),검증3(0.60),변동폭(0.10),수량(7);
input : 손절1(50),익절1(300),TR1(150);
input : 손절2(50),익절2(300),TR2(150);
input : 손절3(50),익절3(300),TR3(150);
input : 손절4(50),익절4(300),TR4(150);
input : 손절5(50),익절5(300),TR5(150);
input : 손절6(50),익절6(300),TR6(150);
input : 손절7(50),익절7(300),TR7(150);
var : C2(0,data1),O2(0,data1),LP(0,data1),ps(0,data1),bh(0,data1),H2(0,data1);
Array : EP[30](0,data1);
C2 = data2(c);
O2 = data2(o);
H2 = data2(H);
ps = data2(PriceScale);
if MarketPosition == 0 and C2 >= 기준+진폭 and O2 < 기준+진폭 and ExitDate(1) != sdate Then
buy("b1");
if MarketPosition == 1 Then
{
bh = highest(H2,BarsSinceEntry);
if MaxEntries > MaxEntries[1] Then
LP = C2[BarsSinceEntry];
EP[MaxEntries] = LP;
if MaxEntries == 1 and MaxContracts < 수량 and O2 < LP+검증1 and C2 >= LP+검증1 Then
buy("b2");
if MaxEntries == 2 and MaxContracts < 수량 and O2 < LP+검증2 and C2 >= LP+검증2 Then
buy("b3");
if MaxEntries == 3 and MaxContracts < 수량 and O2 < LP+검증3 and C2 >= LP+검증3 Then
buy("b4");
if MaxEntries == 4 and MaxContracts < 수량 and O2 < LP+변동폭 and C2 >= LP+변동폭 Then
buy("b5");
if MaxEntries == 5 and MaxContracts < 수량 and O2 < LP+변동폭 and C2 >= LP+변동폭 Then
buy("b6");
if MaxEntries == 6 and MaxContracts < 수량 and O2 < LP+변동폭 and C2 >= LP+변동폭 Then
buy("b7");
if MaxEntries >= 1 and EP[1] > 0 Then
{
if C2 <= EP[1]-ps*손절1 then
ExitLong("bl1",OnClose,def,"b1");
if C2 >= EP[1]+ps*익절1 then
ExitLong("bp1",OnClose,def,"b1");
if C2 <= BH-PS*TR1 Then
ExitLong("btr1",OnClose,def,"b1");
}
if MaxEntries >= 2 and EP[2] > 0 Then
{
if C2 <= EP[2]-ps*손절2 then
ExitLong("bl2",OnClose,def,"b2");
if C2 >= EP[2]+ps*익절1 then
ExitLong("bp2",OnClose,def,"b2");
if C2 <= BH-PS*TR2 Then
ExitLong("btr2",OnClose,def,"b2");
}
if MaxEntries >= 3 and EP[3] > 0 Then
{
if C2 <= EP[3]-ps*손절2 then
ExitLong("bl3",OnClose,def,"b3");
if C2 >= EP[3]+ps*익절1 then
ExitLong("bp3",OnClose,def,"b3");
if C2 <= BH-PS*TR3 Then
ExitLong("btr3",OnClose,def,"b3");
}
if MaxEntries >= 4 and EP[4] > 0 Then
{
if C2 <= EP[4]-ps*손절4 then
ExitLong("bl4",OnClose,def,"b4");
if C2 >= EP[4]+ps*익절4 then
ExitLong("bp4",OnClose,def,"b4");
if C2 <= BH-PS*TR4 Then
ExitLong("btr4",OnClose,def,"b4");
}
if MaxEntries >= 5 and EP[5] > 0 Then
{
if C2 <= EP[5]-ps*손절5 then
ExitLong("bl5",OnClose,def,"b5");
if C2 >= EP[5]+ps*익절5 then
ExitLong("bp5",OnClose,def,"b5");
if C2 <= BH-PS*TR5 Then
ExitLong("btr5",OnClose,def,"b5");
}
if MaxEntries >= 6 and EP[6] > 0 Then
{
if C2 <= EP[6]-ps*손절6 then
ExitLong("bl6",OnClose,def,"b6");
if C2 >= EP[6]+ps*익절6 then
ExitLong("bp6",OnClose,def,"b6");
if C2 <= BH-PS*TR6 Then
ExitLong("btr6",OnClose,def,"b6");
}
if MaxEntries >= 7 and EP[7] > 0 Then
{
if C2 <= EP[7]-ps*손절7 then
ExitLong("bl7",OnClose,def,"b7");
if C2 >= EP[7]+ps*익절7 then
ExitLong("bp7",OnClose,def,"b7");
if C2 <= BH-PS*TR7 Then
ExitLong("btr7",OnClose,def,"b7");
}
}
즐거운 하루되세요
> 목마와숙녀 님이 쓴 글입니다.
> 제목 : 문의
> 보조data 이용 수식으로 변경바랍니다.
항상 고맙습니다.
**************************************************************************************
input : 기준(265),진폭(0.50);
input : 검증1(1.00),검증2(0.8),검증3(0.60),변동폭(0.10),수량(7);
input : 손절1(50),익절1(300),TR1(150);
input : 손절2(50),익절2(300),TR2(150);
input : 손절3(50),익절3(300),TR3(150);
input : 손절4(50),익절4(300),TR4(150);
input : 손절5(50),익절5(300),TR5(150);
input : 손절6(50),익절6(300),TR6(150);
input : 손절7(50),익절7(300),TR7(150);
Array : EP[30](0);
if MarketPosition == 0 and NextBarOpen < 기준+진폭 and ExitDate(1) != sdate Then
buy("b1",AtStop,기준+진폭);
if MarketPosition == 1 Then
{
EP[MaxEntries] = LatestEntryPrice(0);
if MaxEntries == 1 and MaxContracts < 수량 and NextBarOpen < LatestEntryPrice(0)+검증1 Then
buy("b2",AtStop,LatestEntryPrice(0)+검증1);
if MaxEntries == 2 and MaxContracts < 수량 and NextBarOpen < LatestEntryPrice(0)+검증2 Then
buy("b3",AtStop,LatestEntryPrice(0)+검증2);
if MaxEntries == 3 and MaxContracts < 수량 and NextBarOpen < LatestEntryPrice(0)+검증3 Then
buy("b4",AtStop,LatestEntryPrice(0)+검증3);
if MaxEntries == 4 and MaxContracts < 수량 and NextBarOpen < LatestEntryPrice(0)+변동폭 Then
buy("b5",AtStop,LatestEntryPrice(0)+변동폭);
if MaxEntries == 5 and MaxContracts < 수량 and NextBarOpen < LatestEntryPrice(0)+변동폭 Then
buy("b6",AtStop,LatestEntryPrice(0)+변동폭);
if MaxEntries == 6 and MaxContracts < 수량 and NextBarOpen < LatestEntryPrice(0)+변동폭 Then
buy("b7",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");
}
if MaxEntries >= 4 and EP[4] > 0 Then
{
ExitLong("bl4",AtStop,EP[4]-PriceScale*손절4,"b4");
ExitLong("bp4",Atlimit,EP[4]+PriceScale*익절4,"b4");
ExitLong("btr4",AtStop,highest(h,BarsSinceEntry)-PriceScale*TR4,"b4");
}
if MaxEntries >= 5 and EP[5] > 0 Then
{
ExitLong("bl5",AtStop,EP[5]-PriceScale*손절5,"b5");
ExitLong("bp5",Atlimit,EP[5]+PriceScale*익절5,"b5");
ExitLong("btr5",AtStop,highest(h,BarsSinceEntry)-PriceScale*TR5,"b5");
}
if MaxEntries >= 6 and EP[6] > 0 Then
{
ExitLong("bl6",AtStop,EP[6]-PriceScale*손절6,"b6");
ExitLong("bp6",Atlimit,EP[6]+PriceScale*익절6,"b6");
ExitLong("btr6",AtStop,highest(h,BarsSinceEntry)-PriceScale*TR6,"b6");
}
if MaxEntries >= 7 and EP[7] > 0 Then
{
ExitLong("bl7",AtStop,EP[7]-PriceScale*손절7,"b7");
ExitLong("bp7",Atlimit,EP[7]+PriceScale*익절7,"b7");
ExitLong("btr7",AtStop,highest(h,BarsSinceEntry)-PriceScale*TR7,"b7");
}
}
다음글
이전글