답변완료
수식변환 부탁드립니다.
안녕하세요. 하기 두개의 수식은 시그널메이커에서 작성한 것인데요, 예스트레이더로 변환 부탁드려요.
수식1)
Vars : Period1(14), Period2(179);
Vars : ST_Ma1(0), ST_Ma2(0);
ST_Ma1 = AvgFast((O+H+L+C)/4, Period1);
ST_Ma2 = AvgFast((O+H+L+C)/4, Period2);
// 일봉 기준 파란색
Vars : vShortP7(14), vLongP7(173), vSigP7(1);
Vars : vMACD7(0), vSignal7(0);
vMACD7 = MACD(C, vShortP7, vLongP7);
vSignal7 = XAverage(vMACD7, vSigP7);
param : BuyA_ShortLeng(15) // 단기 이동평균 기간
, BuyA_LongLeng(35) // 장기 이동평균 기간
;
var : BuyA_V1(0), BuyA_V2(0), BuyA_Result(FALSE);
BuyA_V1 = SMA(Volume, BuyA_ShortLeng);
BuyA_V2 = SMA(Volume, BuyA_LongLeng);
BuyA_Result = FALSE;
IF BuyA_V1 >= BuyA_V2 Then
BuyA_Result = TRUE;
param : vDn (92), vUp (700);
If BuyA_V1 > vDN And BuyA_V1 < vUp And vMACD7 < 0 And CrossDown(ST_Ma1, ST_Ma2) Then Sell("V매도");
/////////////////////////////////////////////////////////////////////////////
수식2)
Inputs : RangeLength(3), XAvgLength(49), BarstoEnter(17), Factor(13);
Vars : BuyEntry(0), BuySetup(False), BuyCounter(0), LongExitTarget(0);
Vars : SP00(0), AtrV(0);
SP00 = SignalPosition;
AtrV = ATR(30);
Condition1 = High == Highest(High, RangeLength);
Condition2 = Close > High[2];
Condition3 = ema(Close, XAvgLength) > ema(Close, XAvgLength)[1];
If SP00 <> 1 AND Condition1 AND Condition2 AND Condition3 Then
Begin
BuyEntry = MedianPrice[2];
BuyCounter = 0;
BuySetup = True;
LongExitTarget = High + Factor * (High - BuyEntry);
End;
If BuyCounter > BarstoEnter Then BuySetup = False
Else BuyCounter = BuyCounter + 1;
If SP00 = 1 Then
Begin
BuySetup = False;
ExitLong("",atlimit,LongExitTarget);
End;
If BuySetup Then Buy("B",atlimit,BuyEntry);
//# ATR Protective Stop
Inputs: ProtectiveATRs(3);
If SP00 <> 0 Then ExitLong("EL_Protective Stop", atstop, EntryPrice - (AtrV * ProtectiveATRs));
///////////////////////////////////////////////////////////////////////////////////
2020-08-25
952
글번호 141758
시스템
답변완료
수식문의 드립니다(갭보정)
Inputs: FastLen(5), MedLen(20), SlowLen(60);
Variables: FastAvg(0), MedAvg(0), SlowAvg(0);
FastAvg = MA(Close, FastLen);
MedAvg = MA(Close, MedLen);
SlowAvg = MA(Close, SlowLen);
If (FastAvg[1] < MedAvg[1] OR MedAvg[1] < SlowAvg[1]) AND (FastAvg > MedAvg AND MedAvg > SlowAvg) Then
Buy ("MAC3_LE");
If (FastAvg[1] > MedAvg[1] OR MedAvg[1] > SlowAvg[1]) AND (FastAvg < MedAvg AND MedAvg < SlowAvg) Then
Sell ("MAC3_SE");
평범한 MA3 정배열 역배열 함수입니다
이식을 갭보정하고 싶습니다
참고로 3분봉에서 사용하려 합니다
추가로 Macd 베이스라인도 갭보정 부탁드립니다
2020-08-25
1090
글번호 141756
시스템
답변완료
부탁좀 드리겠습니다.
TRIXv = TRIX(period);
emav = ema(c,Period);
if crossup(TRIXv,0) Then
{
value1 = emav;
value3 = emav;
}
if CrossDown(TRIXv,0) Then
value2 = emav;
if value1 > 0 and emav > value1 Then
value1 = emav;
if value2 > 0 and emav < value2 Then
value2 = emav;
if value3 > 0 and emav < value3 Then
value3 = emav;
plot1(value1);
plot2(value2);
plot3(max(value1,emav));
plot4(max(value3,emav));
2) 변환부탁드립니다
highest(high,기간)
lowest(low,기간)
((highest(high,기간))+(lowest(low,기간)))/2
3)
highest(h,period)
HIL=valuewhen(1,(highest(h(1),period)<highest(h,period)),((highest(high,Period)+lowest(low,Period))/2));
highest(H, period)-(((highest(H, period)-HIL)/3)*1)
HIL=valuewhen(1,(highest(h(1),period)<highest(h,period)),((highest(high,Period)+lowest(low,Period))/2));
highest(H, period)-(((highest(H, period)-HIL)/4)*3)
HIL=valuewhen(1,(highest(h(1),period)<highest(h,period)),((highest(high,Period)+lowest(low,Period))/2));
highest(H, period)-(((highest(H, period)-HIL)/5)*3)
HIL=valuewhen(1,(highest(h(1),period)<highest(h,period)),((highest(high,Period)+lowest(low,Period))/2));
highest(H, period)-(((highest(H, period)-HIL)/6)*4)
period = 300
4)
수식1>
highest(h, period)
수식2>
A = (highest(h, period) + lowest(l, period))/2;
B = highest(h, period);
A + (B-A)*4/6
수식3>
A = (highest(h, period) + lowest(l, period))/2;
B = highest(h, period);
A + (B-A)*3/4
수식4>
A = (highest(h, period) + lowest(l, period))/3;
B = highest(h, period);
A + (B-A)*2/5
수식5>
(highest(h, period) + lowest(l, period))/4
period=2000
2020-08-25
1024
글번호 141755
지표
답변완료
buy 함수를 for 문과 함께 사용하는 방법이 있을까요?
Input : base_price(1000);
Arrays : b_price[4](0), b_qty[4](0);
Vars: cnt(1);
For cnt = 1 to 3
{
b_price[cnt] = base_price * (1 - cnt * 0.02); //가격 배열 만들기
b_qty[cnt] = cnt; //수량 배열 만들기
}
If sdate == 20200824 && sTime == 100000 Then //한줄씩 buy 사용
/* {
MessageLog("Price:%.0f, Qty:%.0f, Close:%.0f", b_price[1], b_qty[1], Close);
Buy("Buy1", AtLimit, b_price[1], b_qty[1]);
MessageLog("Price:%.0f, Qty:%.0f, Close:%.0f", b_price[2], b_qty[2], Close);
Buy("Buy2", AtLimit, b_price[2], b_qty[2]);
MessageLog("Price:%.0f, Qty:%.0f, Close:%.0f", b_price[3], b_qty[3], Close);
Buy("Buy3", AtLimit, b_price[3], b_qty[3]);
}
*/
{ //For문 사용
For cnt = 1 to 3
{
MessageLog("Price:%.0f, Qty:%.0f, Close:%.0f", b_price[cnt], b_qty[cnt], Close);
Buy("Buy", AtLimit, b_price[cnt], b_qty[cnt]);
}
}
For 문 없이 사용하면 작동하는데
For 문을 쓰면 매수 이름이 같아져 작동이 안되는듯 합니다.
For 문을 사용해서 buy 함수를 쓰는 방법이 있을까요?
항상 감사합니다. ^^!
2020-08-24
1006
글번호 141753
시스템