커뮤니티
문의드립니다.
2019-04-05 10:40:03
322
글번호 127641
도움주시는 덕분에 도전하고 있습니다. 매번 감사합니다.
한번 변환해보려고 했는데 TS에서 뜻을 검색해서 알아봤자 예스에서 어떻게 변환할 지 모르겠네요;;
1. 기타
{ Search Tag: WA-XAverage }
{ Exponential Moving Average }
inputs:
Price( numericseries ), { price to average }
Length( numericsimple ) ; { this input must be a constant >= 0 }
variables:
intrabarpersist SmoothingFactor( 0 ) ;
once
begin
if Length >= 0 then
SmoothingFactor = 2 / ( Length + 1 )
else
RaiseRuntimeError( !( "The Length input of the XAverage function must be " +
"greater than or equal to 0." ) ) ;
end ;
if CurrentBar = 1 then
XAverage = Price
else
XAverage = XAverage[1] + SmoothingFactor * ( Price - XAverage[1] ) ;
{ ** Copyright © TradeStation Technologies, Inc. All Rights Reserved / 저작권 소유 **
** TradeStation reserves the right to modify or overwrite this analysis technique
with each release. ** }
2. 기타
inputs:
rSIPeriod(numericsimple),
sF(numericsimple),
wF(numericsimple),
Line(numericsimple);
variable:
Wilders_Period(rSIPeriod * 2 - 1),
rsi0(0),
rsi1(0),
dar(0),
tr(0),
trPrev(0),
dv(0),
Value_1(0),
AtrRsi(0),
MaAtrRsi(0);
Value_1 = EMA(RSI(Close, rSIPeriod),sF);
AtrRsi = AbsValue(Value_1[1] - Value_1[0]);
MaAtrRsi = EMA(AtrRsi,Wilders_Period);
tr = trPrev;
rsi1 = Value_1[1];
rsi0 = Value_1[0];
//astra v1.1: Value 4.236 in v1.0 became default value for user adjustable variable "Filter".
dar = EMA(MaAtrRsi, Wilders_Period)[0] * wF; //Filter;
dv = tr;
if (rsi0 < tr) then begin
tr = rsi0 + dar;
if (rsi1 < dv and tr > dv) then
tr = dv;
end
else if (rsi0 > tr) then begin
tr = rsi0 - dar;
if (rsi1 > dv and tr < dv) then
tr = dv;
end;
trPrev = tr;
If Line = 0 then
QQE = Value_1
Else
QQE = tr;
3. 기타
inputs:
CapitalSize(NumericSimple), SLSize(NumericSimple), MoneyManagementType(NumericSimple), TradeSize(NumericSimple), SizeRounding(NumericSimple), RiskPerTrade(NumericSimple), MaxTradeSize(NumericSimple);
vars:
RiskInMoney(0.5), ComputedSize(0);
if(MoneyManagementType = 0 or SLSize <= 0 or MoneyManagementType > 2) then begin
ComputedSize = TradeSize;
End else begin
// compute real money management
if(MoneyManagementType = 1) then begin
// risk % of account per trade
RiskInMoney = ((CapitalSize+NetProfit+OpenPositionProfit) * (RiskPerTrade / 100.0));
ComputedSize = Round( RiskInMoney / (SLSize* BigPointValue), SizeRounding);
End else begin
// risk fixed amount per trade
RiskInMoney = RiskPerTrade;
ComputedSize = Round( RiskInMoney / (SLSize* BigPointValue), SizeRounding);
end;
end;
if(ComputedSize < 1) then
ComputedSize = 2;
if(MoneyManagementType > 0 and ComputedSize > MaxTradeSize) then
ComputedSize = MaxTradeSize;
MoneyManagement = ComputedSize;
답변 1
예스스탁 예스스탁 답변
2019-04-05 14:59:47
안녕하세요
예스스탁입니다.
모두 사용자함수식입니다.
1. XAverage
inputs:
Price( numericseries ), #{ price to average }
Length( numericsimple ) ; #{ this input must be a constant >= 0 }
var : SmoothingFactor(0);
SmoothingFactor = 2 / ( Length + 1 );
if CurrentBar == 1 then
XAverage = Price;
else
XAverage = XAverage[1] + SmoothingFactor * ( Price - XAverage[1] ) ;
2. QQE
inputs:
rSIPeriod(numericsimple),
sF(numericsimple),
wF(numericsimple),
Line(numericsimple);
variable:
Wilders_Period(rSIPeriod * 2 - 1),
rsi0(0),
rsi1(0),
dar(0),
tr(0),
trPrev(0),
dv(0),
Value_1(0),
AtrRsi(0),
MaAtrRsi(0);
Value_1 = EMA(RSI(rSIPeriod),sF);
AtrRsi = AbsValue(Value_1[1] - Value_1[0]);
MaAtrRsi = EMA(AtrRsi,Wilders_Period);
tr = trPrev;
rsi1 = Value_1[1];
rsi0 = Value_1[0];
//astra v1.1: Value 4.236 in v1.0 became default value for user adjustable variable "Filter".
dar = EMA(MaAtrRsi, Wilders_Period)[0] * wF; //Filter;
dv = tr;
if (rsi0 < tr) then begin
tr = rsi0 + dar;
if (rsi1 < dv and tr > dv) then
tr = dv;
end
else if (rsi0 > tr) then begin
tr = rsi0 - dar;
if (rsi1 > dv and tr < dv) then
tr = dv;
end;
trPrev = tr;
If Line == 0 then
QQE = Value_1;
Else
QQE = tr;
3. MoneyManagement
inputs:
CapitalSize(NumericSimple), SLSize(NumericSimple), MoneyManagementType(NumericSimple), TradeSize(NumericSimple), SizeRounding(NumericSimple), RiskPerTrade(NumericSimple), MaxTradeSize(NumericSimple);
vars:
RiskInMoney(0.5), ComputedSize(0);
if(MoneyManagementType == 0 or SLSize <= 0 or MoneyManagementType > 2) then begin
ComputedSize = TradeSize;
End else begin
// compute real money management
if(MoneyManagementType == 1) then begin
// risk % of account per trade
RiskInMoney = ((CapitalSize+NetProfit+OpenPositionProfit) * (RiskPerTrade / 100.0));
ComputedSize = Round( RiskInMoney / (SLSize* BigPointValue), SizeRounding);
End else begin
// risk fixed amount per trade
RiskInMoney = RiskPerTrade;
ComputedSize = Round( RiskInMoney / (SLSize* BigPointValue), SizeRounding);
end;
end;
if(ComputedSize < 1) then
ComputedSize = 2;
if(MoneyManagementType > 0 and ComputedSize > MaxTradeSize) then
ComputedSize = MaxTradeSize;
MoneyManagement = ComputedSize;
즐거운 하루되세요
> 잡다백수 님이 쓴 글입니다.
> 제목 : 문의드립니다.
> 도움주시는 덕분에 도전하고 있습니다. 매번 감사합니다.
한번 변환해보려고 했는데 TS에서 뜻을 검색해서 알아봤자 예스에서 어떻게 변환할 지 모르겠네요;;
1. 기타
{ Search Tag: WA-XAverage }
{ Exponential Moving Average }
inputs:
Price( numericseries ), { price to average }
Length( numericsimple ) ; { this input must be a constant >= 0 }
variables:
intrabarpersist SmoothingFactor( 0 ) ;
once
begin
if Length >= 0 then
SmoothingFactor = 2 / ( Length + 1 )
else
RaiseRuntimeError( !( "The Length input of the XAverage function must be " +
"greater than or equal to 0." ) ) ;
end ;
if CurrentBar = 1 then
XAverage = Price
else
XAverage = XAverage[1] + SmoothingFactor * ( Price - XAverage[1] ) ;
{ ** Copyright © TradeStation Technologies, Inc. All Rights Reserved / 저작권 소유 **
** TradeStation reserves the right to modify or overwrite this analysis technique
with each release. ** }
2. 기타
inputs:
rSIPeriod(numericsimple),
sF(numericsimple),
wF(numericsimple),
Line(numericsimple);
variable:
Wilders_Period(rSIPeriod * 2 - 1),
rsi0(0),
rsi1(0),
dar(0),
tr(0),
trPrev(0),
dv(0),
Value_1(0),
AtrRsi(0),
MaAtrRsi(0);
Value_1 = EMA(RSI(Close, rSIPeriod),sF);
AtrRsi = AbsValue(Value_1[1] - Value_1[0]);
MaAtrRsi = EMA(AtrRsi,Wilders_Period);
tr = trPrev;
rsi1 = Value_1[1];
rsi0 = Value_1[0];
//astra v1.1: Value 4.236 in v1.0 became default value for user adjustable variable "Filter".
dar = EMA(MaAtrRsi, Wilders_Period)[0] * wF; //Filter;
dv = tr;
if (rsi0 < tr) then begin
tr = rsi0 + dar;
if (rsi1 < dv and tr > dv) then
tr = dv;
end
else if (rsi0 > tr) then begin
tr = rsi0 - dar;
if (rsi1 > dv and tr < dv) then
tr = dv;
end;
trPrev = tr;
If Line = 0 then
QQE = Value_1
Else
QQE = tr;
3. 기타
inputs:
CapitalSize(NumericSimple), SLSize(NumericSimple), MoneyManagementType(NumericSimple), TradeSize(NumericSimple), SizeRounding(NumericSimple), RiskPerTrade(NumericSimple), MaxTradeSize(NumericSimple);
vars:
RiskInMoney(0.5), ComputedSize(0);
if(MoneyManagementType = 0 or SLSize <= 0 or MoneyManagementType > 2) then begin
ComputedSize = TradeSize;
End else begin
// compute real money management
if(MoneyManagementType = 1) then begin
// risk % of account per trade
RiskInMoney = ((CapitalSize+NetProfit+OpenPositionProfit) * (RiskPerTrade / 100.0));
ComputedSize = Round( RiskInMoney / (SLSize* BigPointValue), SizeRounding);
End else begin
// risk fixed amount per trade
RiskInMoney = RiskPerTrade;
ComputedSize = Round( RiskInMoney / (SLSize* BigPointValue), SizeRounding);
end;
end;
if(ComputedSize < 1) then
ComputedSize = 2;
if(MoneyManagementType > 0 and ComputedSize > MaxTradeSize) then
ComputedSize = MaxTradeSize;
MoneyManagement = ComputedSize;
다음글