답변완료
수식 문의드립니다
안녕하세요?
아래 코딩과 같이 Swinghigh 함수를 사용하여 좌우 5봉에서 최대 종가값을 구해서
그래프로 표시 하였는데, 현재봉에 5봉전 최대 종가값이 점으로 표시됩니다.
제가 원하는 것은 5봉전에 최대 종가값을 표시하고 싶은데 어떻게 해야 할지 몰라
도움 요청 드립니다, 매번 감사합니다.
Input: Strength(5);
var: mav(0), swing_high(0);
mav = ma(C,Strength);
swing_high = SwingHigh(1, C, Strength, Strength, Strength*2 + 1);
if swing_high != -1 Then
{
Plot1(swing_high);
}
2021-04-23
726
글번호 148347
지표
답변완료
수식작성
input : StartTime(140000),EndTime(055000),xtime(055500);
Input : Period(20);
Input : 당일수익틱수(120);
Var : N1(0),dayPl(0),당일수익(0),Xcond(false);
Var : value(0),Tcond(false);
if sDate != sDate[1] then
SetStopEndofday(xtime);
if (sdate != sdate[1] and stime >= EndTime) or
(sdate == sdate[1] and stime >= EndTime and stime[1] < EndTime) Then
Tcond = False;
if (sdate != sdate[1] and stime >= StartTime) or
(sdate == sdate[1] and stime >= StartTime and stime[1] < StartTime) Then
{
Tcond = true;
SetStopEndofday(0);
Xcond = false;
N1 = NetProfit;
}
당일수익 = PriceScale*당일수익틱수;
daypl = NetProfit-N1;
if TotalTrades > TotalTrades[1] then
{
if daypl >= 당일수익 Then
Xcond = true;
if (IsExitName("dbp",1) == true or IsExitName("dsp",1) == true ) then
Xcond = true;
}
value = VR(Period);
var1 = ma(C,5);
var2 = ma(C,200);
If CrossUP(value, 100) and Xcond == False Then
{
Buy("b");
}
If CrossDown(value, 300) and Xcond == False Then
{
Sell("s");
}
if marketposition == 1 then
{
if isentryname("b") == true and crossdown(var1,var2) then
sell("bs");
if crossdown(var2,var3) Then
Exitlong("sbx",onclose,def,"sb");
ExitLong("dbp",atlimit,EntryPrice+((당일수익-daypl)/CurrentContracts));
if EntryTime >= 140000 and EntryTime < 190000 Then
{
ExitLong("bpx",AtLimit,EntryPrice+PriceScale*20);
ExitLong("blx",AtStop,EntryPrice-PriceScale*20);
}
}
if marketposition == -1 then
{
if isentryname("s") == true and crossup(var1,var2) then
buy("sb");
if crossup(var2,var3) Then
ExitShort("bsx",onclose,def,"bs");
ExitShort("dsp",atlimit,EntryPrice-((당일수익-daypl)/CurrentContracts));
if EntryTime >= 140000 and EntryTime < 190000 Then
{
ExitShort("spx",AtLimit,EntryPrice-PriceScale*20);
ExitShort("slx",AtStop,EntryPrice+PriceScale*20);
}
}
--------------------
위의 수식어에서 추가되는 내용입니다
sell일때 5선 480선 골든크로스는 buy전환
buy 일때 5선 480선 데드크로스는 sell전환의 수식어 추가입니다
2021-04-23
955
글번호 148327
시스템
답변완료
수식작성
Inputs: PercentRLen(10), OverSold(10), OverBought(90), Trigger(62);
Variables: PcntR(0), AvgValue(0), Setup1(False), Setup2(False);
PcntR = PercentR(PercentRLen);
AvgValue = MA(Close, PercentRLen);
If PcntR < OverSold Then
Setup1 = True;
If PcntR > OverBought Then
Setup1 = False;
If PcntR > OverBought Then
Setup2 = True;
If PcntR < OverSold Then
Setup2 = False;
If Setup1 AND AvgValue > AvgValue[1] AND Crossup(PcntR,Trigger) Then Begin
Setup1 = False;
Buy ("%R_LE");
End;
If Setup2 AND AvgValue < AvgValue[1] AND CrossDown(PcntR, Trigger) Then Begin
Setup2 = False;
Sell ("%R_SE");
End;
----------------------
위는 PercentR 기본수식어 입니다
이동평균선 460선위에서 sell신호는 바로 buy신호로
이동평균선 460선아래에서는 buy신호는 바로 sell신호로 전환하는 수식어와
460선 아래에서 sell신호중 5선 460선 골든크로스에서 buy로 전환하는 신호와
460선 위에서 buy신호중 5선 460선 데드크로스에서 buy로 전환하는 신호를 부탁드립니다.
2021-04-23
1199
글번호 148325
시스템