예스스탁
예스스탁 답변
2020-09-15 11:10:22
안녕하세요
예스스탁입니다.
이평크로스 후에 n개봉 이내에 지정한 값에 도달해야만 진입이 발생합니다.
이평과 LEntryPrice,SEntryPrice라인이 그려지게 작성해 드립니다.
Input: FastLen(9), SlowLen(18), ChLen(12), TrailBar(8);
Vars: FastMA(0), SlowMA(0), LEntryPrice(0), SEntryPrice(0),LCount(0),SCount(0);
FastMA = ma( Close , FastLen );
SlowMA = ma( Close , SlowLen );
Plot1(FastMA,"이평1");
Plot2(SlowMA,"이평2");
If CrossUp(FastMA,SlowMA) then
Begin
LEntryPrice = Highest( High , TrailBar )[1] * 1.02;
LCount = index;
End;
If index < LCount + ChLen and LCount > 0 then
Plot3(LEntryPrice,"매수선",RED);
Else
NoPlot(3);
If CrossDown(FastMA,SlowMA) then
Begin
SEntryPrice = Lowest( Low , TrailBar )[1] *.98;
SCount = index;
End;
If index < SCount + ChLen and SCount > 0 then
Plot4(SEntryPrice,"매도선",BLUE);
Else
NoPlot(4);
즐거운 하루되세요
> 잘웃자 님이 쓴 글입니다.
> 제목 : 시스템식 지표로 변환 부탁드립니다.
> 안녕하세요
아래 시스템식을 지표로 변경을 해보고 싶은데요
FastMA, SlowMA 을 선으로 나타내고
매도, 매수, RETRY 등을 점으로 표시하도록 하고싶습니다.
바쁘시겠지만 도움 부탁드리겠습니다.
감사합니다.
Input: FastLen(9), SlowLen(18), ChLen(12), TrailBar(8), Initial(300), ReBars(15), Reentry(100);
Vars: FastMA(0), SlowMA(0), LEntryPrice(0), SEntryPrice(0), LCount(-999), SCount(-999),
ReEntryCount(0), CurrentPosition(0);
FastMA = ma( Close , FastLen );
SlowMA = ma( Close , SlowLen );
#{ Order Placement for Long Positions }
If CrossUp(FastMA,SlowMA) then Begin
LEntryPrice = Highest( High , TrailBar )[1] * 1.02;
LCount = index;
End;
If MarketPosition <> 1 AND index < LCount + ChLen and LCount > 0 then
Buy("Cross Over Buy",AtStop,LEntryPrice,Initial);
#{ Order Placement for Short Positions }
If CrossDown(FastMA,SlowMA) then Begin
SEntryPrice = Lowest( Low , TrailBar )[1] *.98;
SCount = index;
End;
If MarketPosition <> -1 AND index < SCount + ChLen and SCount > 0 then
Sell("Cross Under Buy",AtStop,SEntryPrice,Initial);
#{ Trailing Stop while in Position }
If MarketPosition == 1 then begin
LCount = -999;
ExitLong("LongTStop",AtStop,Lowest(Low,TrailBar));
End;
If MarketPosition == -1 then Begin
SCount = -999;
ExitShort("ShortTStop",AtStop,Highest(High,TrailBar));
End;
#{ Reentry Technique }
CurrentPosition = MarketPosition;
If MarketPosition == 0 AND MarketPosition == -1 then
ReEntryCount = 1;
If MarketPosition == 0 AND MarketPosition[1] == 1 then
ReEntryCount = 1;
If MarketPosition == 0 AND MarketPosition(1) == 1 AND ReEntryCount < ReBars then Begin
ReEntryCount = ReEntryCount + 1;
Buy("Long ReEntry",AtStop,Highest(High,10),Reentry);
End;
If MarketPosition == 0 AND MarketPosition(1) == -1 AND ReEntryCount < ReBars then Begin
ReEntryCount = ReEntryCount + 1;
Sell("Short ReEntry",AtStop,Lowest(Low,10),Reentry);
End;