커뮤니티
문의드립니다
2018-12-26 14:10:57
241
글번호 124778
아래 2가지 수식에서 매매시간을 10시15분~17시 까지만 되게 수정 부탁드립니다
1.
Inputs: ConsecutiveOBV(3), Length(15), Pval(0.05);
Variables: OBVcalc(0);
OBVcalc = OBV() * 0.0001;
If CountIF(OBVcalc > Highest(OBVcalc, Length)[1], ConsecutiveOBV) == ConsecutiveOBV Then
Buy ("매수", AtStop, Close + Pval);
If CountIF(OBVcalc < Lowest(OBVcalc, Length)[1], ConsecutiveOBV) == ConsecutiveOBV Then
Sell ("매도", AtStop, Close - Pval);
var : RR(0),tx(0);
if MarketPosition == 1 Then{
rr = Floor((highest(H,BarsSinceEntry)-EntryPrice)/(PriceScale*10));
if rr > rr[1] Then{
tx = Text_New(sdate,stime,H+PriceScale*1,NumToStr(RR*10,0)+"틱");
Text_SetStyle(tx,2,2);
Text_SetColor(tx,YELLOW);
}
}
if MarketPosition == -1 Then{
rr = Floor((EntryPrice-lowest(L,BarsSinceEntry))/(PriceScale*10));
if rr > rr[1] Then{
tx = Text_New(sdate,stime,L-PriceScale*1,NumToStr(RR*10,0)+"틱");
Text_SetStyle(tx,2,2);
Text_SetColor(tx,YELLOW);
}
}
2.
Input : af(0.02), maxAF(0.2);
Var : value(0);
value = sar(af,maxAF);
If crossup(c,value) Then
{
Buy("매수");
}
If CrossDown(c,value) Then
{
sell("매도");
}
var : RR(0),tx(0);
if MarketPosition == 1 Then{
rr = Floor((highest(H,BarsSinceEntry)-EntryPrice)/(PriceScale*10));
if rr > rr[1] Then{
tx = Text_New(sdate,stime,H+PriceScale*1,NumToStr(RR*10,0)+"틱");
Text_SetStyle(tx,2,2);
Text_SetColor(tx,YELLOW);
}
}
if MarketPosition == -1 Then{
rr = Floor((EntryPrice-lowest(L,BarsSinceEntry))/(PriceScale*10));
if rr > rr[1] Then{
tx = Text_New(sdate,stime,L-PriceScale*1,NumToStr(RR*10,0)+"틱");
Text_SetStyle(tx,2,2);
Text_SetColor(tx,YELLOW);
}
}
답변 1
예스스탁 예스스탁 답변
2018-12-26 16:08:38
안녕하세요
예스스탁입니다.
1.
Inputs: ConsecutiveOBV(3), Length(15), Pval(0.05);
Variables: OBVcalc(0);
input : starttime(223000),endtime(050000);
var : Tcond(false);
if (sdate != sdate[1] and stime >= starttime) or
(sdate == sdate[1] and stime >= starttime and stime[1] < starttime) then
{
Tcond = true;
}
if (sdate != sdate[1] and stime >= endtime) or
(sdate == sdate[1] and stime >= endtime and stime[1] < endtime) then
{
Tcond = false;
if MarketPosition == 1 Then
ExitLong("bx");
if MarketPosition == -1 Then
ExitShort("sx");
}
OBVcalc = OBV() * 0.0001;
If CountIF(OBVcalc > Highest(OBVcalc, Length)[1], ConsecutiveOBV) == ConsecutiveOBV and Tcond == true Then
Buy ("매수", AtStop, Close + Pval);
If CountIF(OBVcalc < Lowest(OBVcalc, Length)[1], ConsecutiveOBV) == ConsecutiveOBV and Tcond == true Then
Sell ("매도", AtStop, Close - Pval);
var : RR(0),tx(0);
if MarketPosition == 1 Then{
rr = Floor((highest(H,BarsSinceEntry)-EntryPrice)/(PriceScale*10));
if rr > rr[1] Then{
tx = Text_New(sdate,stime,H+PriceScale*1,NumToStr(RR*10,0)+"틱");
Text_SetStyle(tx,2,2);
Text_SetColor(tx,YELLOW);
}
}
if MarketPosition == -1 Then{
rr = Floor((EntryPrice-lowest(L,BarsSinceEntry))/(PriceScale*10));
if rr > rr[1] Then{
tx = Text_New(sdate,stime,L-PriceScale*1,NumToStr(RR*10,0)+"틱");
Text_SetStyle(tx,2,2);
Text_SetColor(tx,YELLOW);
}
}
2
Input : af(0.02), maxAF(0.2);
Var : value(0);
input : starttime(223000),endtime(050000);
var : Tcond(false);
if (sdate != sdate[1] and stime >= starttime) or
(sdate == sdate[1] and stime >= starttime and stime[1] < starttime) then
{
Tcond = true;
}
if (sdate != sdate[1] and stime >= endtime) or
(sdate == sdate[1] and stime >= endtime and stime[1] < endtime) then
{
Tcond = false;
if MarketPosition == 1 Then
ExitLong("bx");
if MarketPosition == -1 Then
ExitShort("sx");
}
value = sar(af,maxAF);
If crossup(c,value) and Tcond == true Then
{
Buy("매수");
}
If CrossDown(c,value) and Tcond == true Then
{
sell("매도");
}
var : RR(0),tx(0);
if MarketPosition == 1 Then{
rr = Floor((highest(H,BarsSinceEntry)-EntryPrice)/(PriceScale*10));
if rr > rr[1] Then{
tx = Text_New(sdate,stime,H+PriceScale*1,NumToStr(RR*10,0)+"틱");
Text_SetStyle(tx,2,2);
Text_SetColor(tx,YELLOW);
}
}
if MarketPosition == -1 Then{
rr = Floor((EntryPrice-lowest(L,BarsSinceEntry))/(PriceScale*10));
if rr > rr[1] Then{
tx = Text_New(sdate,stime,L-PriceScale*1,NumToStr(RR*10,0)+"틱");
Text_SetStyle(tx,2,2);
Text_SetColor(tx,YELLOW);
}
}
즐거운 하루되세요
> 해피슈 님이 쓴 글입니다.
> 제목 : 문의드립니다
> 아래 2가지 수식에서 매매시간을 10시15분~17시 까지만 되게 수정 부탁드립니다
1.
Inputs: ConsecutiveOBV(3), Length(15), Pval(0.05);
Variables: OBVcalc(0);
OBVcalc = OBV() * 0.0001;
If CountIF(OBVcalc > Highest(OBVcalc, Length)[1], ConsecutiveOBV) == ConsecutiveOBV Then
Buy ("매수", AtStop, Close + Pval);
If CountIF(OBVcalc < Lowest(OBVcalc, Length)[1], ConsecutiveOBV) == ConsecutiveOBV Then
Sell ("매도", AtStop, Close - Pval);
var : RR(0),tx(0);
if MarketPosition == 1 Then{
rr = Floor((highest(H,BarsSinceEntry)-EntryPrice)/(PriceScale*10));
if rr > rr[1] Then{
tx = Text_New(sdate,stime,H+PriceScale*1,NumToStr(RR*10,0)+"틱");
Text_SetStyle(tx,2,2);
Text_SetColor(tx,YELLOW);
}
}
if MarketPosition == -1 Then{
rr = Floor((EntryPrice-lowest(L,BarsSinceEntry))/(PriceScale*10));
if rr > rr[1] Then{
tx = Text_New(sdate,stime,L-PriceScale*1,NumToStr(RR*10,0)+"틱");
Text_SetStyle(tx,2,2);
Text_SetColor(tx,YELLOW);
}
}
2.
Input : af(0.02), maxAF(0.2);
Var : value(0);
value = sar(af,maxAF);
If crossup(c,value) Then
{
Buy("매수");
}
If CrossDown(c,value) Then
{
sell("매도");
}
var : RR(0),tx(0);
if MarketPosition == 1 Then{
rr = Floor((highest(H,BarsSinceEntry)-EntryPrice)/(PriceScale*10));
if rr > rr[1] Then{
tx = Text_New(sdate,stime,H+PriceScale*1,NumToStr(RR*10,0)+"틱");
Text_SetStyle(tx,2,2);
Text_SetColor(tx,YELLOW);
}
}
if MarketPosition == -1 Then{
rr = Floor((EntryPrice-lowest(L,BarsSinceEntry))/(PriceScale*10));
if rr > rr[1] Then{
tx = Text_New(sdate,stime,L-PriceScale*1,NumToStr(RR*10,0)+"틱");
Text_SetStyle(tx,2,2);
Text_SetColor(tx,YELLOW);
}
}
다음글
이전글