예스스탁
예스스탁 답변
2024-05-27 16:20:01
안녕하세요
예스스탁입니다.
input : P1(10),P2(20),P3(60);
input : 틱단위(10),글자크기(9);
input : 익절틱수(80),손절틱수(80);
Input : Pe1(5),Pe2(20);
Input : Pcolor(20);
Input : Tentick(1.0);
var : pp(0),ll(0),tx(0);
var : Sma1(0),Sma2(0),color(0);
var : 틱차이(0);
var : a(0);
a = Close;
var1 = ma(C,Pcolor);
var2 = highest(h,18);
Var3 = lowest(l,18);
Sma1 = ma(C,Pe1); #5일선
Sma2 = ma(C,Pe2); #20일선
if (c<Sma1) and (c<Sma2) and var1 > var1[1] or (c<Sma1) and var1 > var1[1] Then
buy("매수",atlimit,a-tentick); #0.05는 1틱 신호종가의 10틱 아래에서 매수
#Buy("b");
#buy("매수",atlimit,a-Onetick);
if (c>Sma1) and (c>Sma2) and var1 < var1[1] or (c>Sma1) and var1 < var1[1] Then
Sell("s");
#sell("매도",atlimit,a+Onetick);
if MarketPosition == 1 Then
{
pp = Floor((highest(H,BarsSinceEntry)-EntryPrice)/(PriceScale*틱단위));
if pp > pp[1] Then
{
tx = Text_New(sdate,stime,H+PriceScale*3,NumToStr(pp*틱단위,0)+"틱");
Text_SetStyle(tx,2,1);
Text_SetSize(tx,글자크기);
}
if C > Var2[1] Then
ExitLong();
}
if MarketPosition == -1 Then
{
pp = Floor((EntryPrice-lowest(L,BarsSinceEntry))/(PriceScale*틱단위));
if pp > pp[1] Then
{
tx = Text_New(sdate,stime,L-PriceScale*3,NumToStr(pp*틱단위,0)+"틱");
Text_SetStyle(tx,2,0);
Text_SetSize(tx,글자크기);
}
if C < Var3[1] Then
ExitShort();
}
SetStopProfittarget(PriceScale*익절틱수,PointStop);
SetStopLoss(PriceScale*손절틱수,PointStop);
즐거운 하루되세요
> runriver 님이 쓴 글입니다.
> 제목 : 청산수식 부탁드려요
> 아래 var2와 var3를 이용하여 청산을 하고 싶습니다.
맨 아래줄 청산식을
매수진입후 var2를 돌파한 봉에서 청산,매도진입후 var3를 돌파한 봉에서 청산
이렇게입니다. 수고하세요
input : P1(10),P2(20),P3(60);
input : 틱단위(10),글자크기(9);
input : 익절틱수(80),손절틱수(80);
Input : Pe1(5),Pe2(20);
Input : Pcolor(20);
Input : Tentick(1.0);
var : pp(0),ll(0),tx(0);
var : Sma1(0),Sma2(0),color(0);
var : 틱차이(0);
var : a(0);
a = Close;
var1 = ma(C,Pcolor);
var2 = highest(h,18);
Var3 = lowest(l,18);
Sma1 = ma(C,Pe1); #5일선
Sma2 = ma(C,Pe2); #20일선
if (c<Sma1) and (c<Sma2) and var1 > var1[1] or (c<Sma1) and var1 > var1[1] Then
buy("매수",atlimit,a-tentick); #0.05는 1틱 신호종가의 10틱 아래에서 매수
#Buy("b");
#buy("매수",atlimit,a-Onetick);
if (c>Sma1) and (c>Sma2) and var1 < var1[1] or (c>Sma1) and var1 < var1[1] Then
Sell("s");
#sell("매도",atlimit,a+Onetick);
if MarketPosition == 1 Then
{
pp = Floor((highest(H,BarsSinceEntry)-EntryPrice)/(PriceScale*틱단위));
if pp > pp[1] Then
{
tx = Text_New(sdate,stime,H+PriceScale*3,NumToStr(pp*틱단위,0)+"틱");
Text_SetStyle(tx,2,1);
Text_SetSize(tx,글자크기);
}
}
if MarketPosition == -1 Then
{
pp = Floor((EntryPrice-lowest(L,BarsSinceEntry))/(PriceScale*틱단위));
if pp > pp[1] Then
{
tx = Text_New(sdate,stime,L-PriceScale*3,NumToStr(pp*틱단위,0)+"틱");
Text_SetStyle(tx,2,0);
Text_SetSize(tx,글자크기);
}
}
SetStopProfittarget(PriceScale*익절틱수,PointStop);
SetStopLoss(PriceScale*손절틱수,PointStop);