커뮤니티
수정좀 부탁합니다.
2017-02-16 12:30:31
95
글번호 106897
아래 수식에서 청산식좀 삽입해주세요.
청산 조건
진입가로 부터 3틱 더 오른뒤 현재 캔들의 종가가 5일이평 아래 있으면 매수청산.
진입가로 부터 3틱 더 내린뒤 현재 캔들의 종가가 5일이평 위에 있으면 매도청산.
input : P(9);
var : T(0), moveLine(0), OrderValue(0);
moveLine = ma(C,P);
if (T <= 0 and (moveLine > moveLine[1])) Then
{
OrderValue = Close;
T = 1;
}
if (T >= 0 and (moveLine < moveLine[1])) Then
{
OrderValue = Close;
T = -1;
}
if T == 1 then
if (Close >= (OrderValue + (PriceScale * 1))) then
//buy("매수",AtStop,value1+PriceScale*1);
Buy("매수", OnClose);
if T == -1 then
//sell("매도",AtStop,value1-PriceScale*1);
if (Close <= (OrderValue - (PriceScale *1))) then
Sell("매도", OnClose);
if MarketPosition == 1 Then{
var1 = Floor((highest(H,BarsSinceEntry)-EntryPrice)/(PriceScale*3));
if var1 > var1[1] Then
Text_New(sdate,stime,H,NumToStr(var1*3,0)+"틱");
}
if MarketPosition == -1 Then{
var1 = Floor((EntryPrice-Lowest(L,BarsSinceEntry))/(PriceScale*3));
if var1 > var1[1] Then
Text_New(sdate,stime,H,NumToStr(var1*3,0)+"틱");
}
답변 1
예스스탁 예스스탁 답변
2017-02-16 14:33:17
안녕하세요
예스스탁입니다.
input : P(9);
var : T(0), moveLine(0), OrderValue(0);
moveLine = ma(C,P);
if (T <= 0 and (moveLine > moveLine[1])) Then
{
OrderValue = Close;
T = 1;
}
if (T >= 0 and (moveLine < moveLine[1])) Then
{
OrderValue = Close;
T = -1;
}
if T == 1 then
if (Close >= (OrderValue + (PriceScale * 1))) then
//buy("매수",AtStop,value1+PriceScale*1);
Buy("매수", OnClose);
if T == -1 then
//sell("매도",AtStop,value1-PriceScale*1);
if (Close <= (OrderValue - (PriceScale *1))) then
Sell("매도", OnClose);
if MarketPosition == 1 Then{
var1 = Floor((highest(H,BarsSinceEntry)-EntryPrice)/(PriceScale*3));
if var1 > var1[1] Then
Text_New(sdate,stime,H,NumToStr(var1*3,0)+"틱");
if highest(H,BarsSinceEntry) >= EntryPrice+PriceScale*3 and C < ma(c,5) Then
exitlong();
}
if MarketPosition == -1 Then{
var1 = Floor((EntryPrice-Lowest(L,BarsSinceEntry))/(PriceScale*3));
if var1 > var1[1] Then
Text_New(sdate,stime,H,NumToStr(var1*3,0)+"틱");
if lowest(L,BarsSinceEntry) <= EntryPrice-PriceScale*3 and C > ma(c,5) Then
ExitShort();
}
즐거운 하루되세요
> 천왕봉 님이 쓴 글입니다.
> 제목 : 수정좀 부탁합니다.
> 아래 수식에서 청산식좀 삽입해주세요.
청산 조건
진입가로 부터 3틱 더 오른뒤 현재 캔들의 종가가 5일이평 아래 있으면 매수청산.
진입가로 부터 3틱 더 내린뒤 현재 캔들의 종가가 5일이평 위에 있으면 매도청산.
input : P(9);
var : T(0), moveLine(0), OrderValue(0);
moveLine = ma(C,P);
if (T <= 0 and (moveLine > moveLine[1])) Then
{
OrderValue = Close;
T = 1;
}
if (T >= 0 and (moveLine < moveLine[1])) Then
{
OrderValue = Close;
T = -1;
}
if T == 1 then
if (Close >= (OrderValue + (PriceScale * 1))) then
//buy("매수",AtStop,value1+PriceScale*1);
Buy("매수", OnClose);
if T == -1 then
//sell("매도",AtStop,value1-PriceScale*1);
if (Close <= (OrderValue - (PriceScale *1))) then
Sell("매도", OnClose);
if MarketPosition == 1 Then{
var1 = Floor((highest(H,BarsSinceEntry)-EntryPrice)/(PriceScale*3));
if var1 > var1[1] Then
Text_New(sdate,stime,H,NumToStr(var1*3,0)+"틱");
}
if MarketPosition == -1 Then{
var1 = Floor((EntryPrice-Lowest(L,BarsSinceEntry))/(PriceScale*3));
if var1 > var1[1] Then
Text_New(sdate,stime,H,NumToStr(var1*3,0)+"틱");
}