커뮤니티
안녕하세요
2018-07-04 11:23:52
125
글번호 120273
아래식에서 매수포지션 진입후에 스토캐스틱25.5가 50아래로 데드크로스하면 매수청산
매도포지션 진입후에 스토캐스틱25.5가 50위로 골드크로스하면 매도청산
추가부탁드립니다
input : sto1(10),sto2(5);
Inputs: TurnLen(50), PrdLen1(100);
Input : 당일손실틱수(800),당일수익틱수(800);
var : 전환선(0),기준선(0),stok(0),Tcond(false);
var : HH(0),LL(0),T1(0),entry(0);
var : DH(0),DL(0);
var : cnt(0),count(0),dayPl(0),당일손실(0),당일수익(0);
var : Xcond(false),N1(0);
당일수익 = PriceScale*당일수익틱수;
당일손실 = PriceScale*당일손실틱수;
전환선 = (highest(H,TurnLen)+lowest(L,TurnLen))/2;
기준선 = (highest(H, PrdLen1)+lowest(L, PrdLen1))/2;
stok = StochasticsK(sto1,sto2);
if (sdate != sdate[1] and stime >= 070000) or
(sdate == sdate[1] and stime >= 070000 and stime[1] < 070000) Then{
Condition1 = true;
DH = H;
DL = L;
Xcond = false;
N1 = NetProfit;
}
daypl = NetProfit-N1;
if TotalTrades > TotalTrades[1] and
(IsExitName("dbp",1) == true or IsExitName("dbl",1) == true or
IsExitName("dsp",1) == true or IsExitName("dsl",1) == true) then
Xcond = true;
if Condition1 == true then{
if H > DH Then
DH = H;
if L < DL Then
DL = L;
}
if stime == 070000 or (stime > 070000 and stime[1] < 070000) Then
{
HH = H;
LL = L;
T1 = TotalTrades;
}
if MarketPosition == 0 Then
entry = TotalTrades-T1;
Else
entry = TotalTrades-T1+1;
if stime >= 103000 and stime < 170000 then{
if H > HH Then
HH = H;
if L < LL Then
LL = L;
if HH >= LL+PriceScale*10 and entry < 20 and Xcond == false then
{
if 전환선 > 기준선 and crossup(stok,20) Then
buy();
if 전환선 < 기준선 and CrossDown(stok,80) Then
sell();
}
}
SetStopLoss(PriceScale*50,PointStop);
SetStopProfittarget(PriceScale*80,PointStop);
if MarketPosition == 1 then{
ExitLong("dbp",atlimit,EntryPrice+((당일수익-daypl)/CurrentContracts));
ExitLong("dbl",AtStop,EntryPrice-((당일손실+daypl)/CurrentContracts));
}
if MarketPosition == -1 then{
ExitShort("dsp",atlimit,EntryPrice-((당일수익-daypl)/CurrentContracts));
ExitShort("dsl",AtStop,EntryPrice+((당일손실+daypl)/CurrentContracts));
}
if MarketPosition == 10 Then{
HH = highest(H,BarsSinceEntry);
if HH >= EntryPrice+PriceScale*40 and HH < EntryPrice+PriceScale*50 Then
ExitLong("bx",AtStop,EntryPrice+PriceScale*10);
if MarketPosition == -10 Then{
LL = lowest(L,BarsSinceEntry);
if LL <= EntryPrice-PriceScale*40 and LL > EntryPrice-PriceScale*50 Then
Exitshort("sx",AtStop,EntryPrice-PriceScale*10);
}
}
답변 1
예스스탁 예스스탁 답변
2018-07-04 14:15:24
안녕하세요
예스스탁입니다.
input : sto1(10),sto2(5),P1(25),P2(5);
Inputs: TurnLen(50), PrdLen1(100);
Input : 당일손실틱수(800),당일수익틱수(800);
var : 전환선(0),기준선(0),stok(0),stok1(0),Tcond(false);
var : HH(0),LL(0),T1(0),entry(0);
var : DH(0),DL(0);
var : cnt(0),count(0),dayPl(0),당일손실(0),당일수익(0);
var : Xcond(false),N1(0);
당일수익 = PriceScale*당일수익틱수;
당일손실 = PriceScale*당일손실틱수;
전환선 = (highest(H,TurnLen)+lowest(L,TurnLen))/2;
기준선 = (highest(H, PrdLen1)+lowest(L, PrdLen1))/2;
stok = StochasticsK(sto1,sto2);
stok1 = StochasticsK(P1,P2);
if (sdate != sdate[1] and stime >= 070000) or
(sdate == sdate[1] and stime >= 070000 and stime[1] < 070000) Then{
Condition1 = true;
DH = H;
DL = L;
Xcond = false;
N1 = NetProfit;
}
daypl = NetProfit-N1;
if TotalTrades > TotalTrades[1] and
(IsExitName("dbp",1) == true or IsExitName("dbl",1) == true or
IsExitName("dsp",1) == true or IsExitName("dsl",1) == true) then
Xcond = true;
if Condition1 == true then{
if H > DH Then
DH = H;
if L < DL Then
DL = L;
}
if stime == 070000 or (stime > 070000 and stime[1] < 070000) Then
{
HH = H;
LL = L;
T1 = TotalTrades;
}
if MarketPosition == 0 Then
entry = TotalTrades-T1;
Else
entry = TotalTrades-T1+1;
if stime >= 103000 and stime < 170000 then{
if H > HH Then
HH = H;
if L < LL Then
LL = L;
if HH >= LL+PriceScale*10 and entry < 20 and Xcond == false then
{
if 전환선 > 기준선 and crossup(stok,20) Then
buy();
if 전환선 < 기준선 and CrossDown(stok,80) Then
sell();
}
}
SetStopLoss(PriceScale*50,PointStop);
SetStopProfittarget(PriceScale*80,PointStop);
if MarketPosition == 1 then{
ExitLong("dbp",atlimit,EntryPrice+((당일수익-daypl)/CurrentContracts));
ExitLong("dbl",AtStop,EntryPrice-((당일손실+daypl)/CurrentContracts));
if CrossDown(stok1,50) Then
ExitLong();
}
if MarketPosition == -1 then{
ExitShort("dsp",atlimit,EntryPrice-((당일수익-daypl)/CurrentContracts));
ExitShort("dsl",AtStop,EntryPrice+((당일손실+daypl)/CurrentContracts));
if CrossUp(stok1,50) Then
ExitShort();
}
if MarketPosition == 10 Then{
HH = highest(H,BarsSinceEntry);
if HH >= EntryPrice+PriceScale*40 and HH < EntryPrice+PriceScale*50 Then
ExitLong("bx",AtStop,EntryPrice+PriceScale*10);
if MarketPosition == -10 Then{
LL = lowest(L,BarsSinceEntry);
if LL <= EntryPrice-PriceScale*40 and LL > EntryPrice-PriceScale*50 Then
Exitshort("sx",AtStop,EntryPrice-PriceScale*10);
}
}
즐거운 하루되세요
> 수원 님이 쓴 글입니다.
> 제목 : 안녕하세요
> 아래식에서 매수포지션 진입후에 스토캐스틱25.5가 50아래로 데드크로스하면 매수청산
매도포지션 진입후에 스토캐스틱25.5가 50위로 골드크로스하면 매도청산
추가부탁드립니다
input : sto1(10),sto2(5);
Inputs: TurnLen(50), PrdLen1(100);
Input : 당일손실틱수(800),당일수익틱수(800);
var : 전환선(0),기준선(0),stok(0),Tcond(false);
var : HH(0),LL(0),T1(0),entry(0);
var : DH(0),DL(0);
var : cnt(0),count(0),dayPl(0),당일손실(0),당일수익(0);
var : Xcond(false),N1(0);
당일수익 = PriceScale*당일수익틱수;
당일손실 = PriceScale*당일손실틱수;
전환선 = (highest(H,TurnLen)+lowest(L,TurnLen))/2;
기준선 = (highest(H, PrdLen1)+lowest(L, PrdLen1))/2;
stok = StochasticsK(sto1,sto2);
if (sdate != sdate[1] and stime >= 070000) or
(sdate == sdate[1] and stime >= 070000 and stime[1] < 070000) Then{
Condition1 = true;
DH = H;
DL = L;
Xcond = false;
N1 = NetProfit;
}
daypl = NetProfit-N1;
if TotalTrades > TotalTrades[1] and
(IsExitName("dbp",1) == true or IsExitName("dbl",1) == true or
IsExitName("dsp",1) == true or IsExitName("dsl",1) == true) then
Xcond = true;
if Condition1 == true then{
if H > DH Then
DH = H;
if L < DL Then
DL = L;
}
if stime == 070000 or (stime > 070000 and stime[1] < 070000) Then
{
HH = H;
LL = L;
T1 = TotalTrades;
}
if MarketPosition == 0 Then
entry = TotalTrades-T1;
Else
entry = TotalTrades-T1+1;
if stime >= 103000 and stime < 170000 then{
if H > HH Then
HH = H;
if L < LL Then
LL = L;
if HH >= LL+PriceScale*10 and entry < 20 and Xcond == false then
{
if 전환선 > 기준선 and crossup(stok,20) Then
buy();
if 전환선 < 기준선 and CrossDown(stok,80) Then
sell();
}
}
SetStopLoss(PriceScale*50,PointStop);
SetStopProfittarget(PriceScale*80,PointStop);
if MarketPosition == 1 then{
ExitLong("dbp",atlimit,EntryPrice+((당일수익-daypl)/CurrentContracts));
ExitLong("dbl",AtStop,EntryPrice-((당일손실+daypl)/CurrentContracts));
}
if MarketPosition == -1 then{
ExitShort("dsp",atlimit,EntryPrice-((당일수익-daypl)/CurrentContracts));
ExitShort("dsl",AtStop,EntryPrice+((당일손실+daypl)/CurrentContracts));
}
if MarketPosition == 10 Then{
HH = highest(H,BarsSinceEntry);
if HH >= EntryPrice+PriceScale*40 and HH < EntryPrice+PriceScale*50 Then
ExitLong("bx",AtStop,EntryPrice+PriceScale*10);
if MarketPosition == -10 Then{
LL = lowest(L,BarsSinceEntry);
if LL <= EntryPrice-PriceScale*40 and LL > EntryPrice-PriceScale*50 Then
Exitshort("sx",AtStop,EntryPrice-PriceScale*10);
}
}
다음글
이전글