커뮤니티
문의드립니다.
2018-09-21 09:43:11
309
글번호 122216
도움주시는 덕분에 도전하고 있습니다. 매번 감사합니다. 즐거운 명절 되세요.
1. 기타
59300 수식(추가답변에 달린 추가진입하는 버전으로) sell도 가능하게 수정 부탁드립니다.
2. 기타
59300수식을 선물에다가도 적용가능한가요?
3.
예스로 수정부탁드립니다.
// Indicator: Fisherized Deviation Scaled Oscillator
inputs:
Period( 40 ),
OverBought( 2 ),
OverSold( -2 ),
OutPutData( false ),
FilePath( "C:ProbabilityDensity.CSV" ) ;
variables:
a1( 0 ), b1( 0 ), c1( 0 ), c2( 0 ),
c3( 0 ), Zeros( 0 ), Filt( 0 ), RMS( 0 ),
count( 0 ), ScaledFilt( 0 ), FisherFilt( 0 ),
Idx( 0 ), J( 0 ), K( 0 ) ;
arrays:
Bin[61](0);
if CurrentBar = 1 Then
//once
begin
//Smooth with a Super Smoother
a1 = expvalue( -1.414 * 3.14159 / ( .5 * Period ) ) ;
b1 = 2 * a1 * Cosine( 1.414 * 180 / ( .5 * Period ) ) ;
c2 = b1 ;
c3 = -a1 * a1 ;
c1 = 1 - c2 - c3 ;
end ;
//Produce Nominal zero mean with zeros in the transfer response
at
//DC and Nyquist with no spectral distortion
//Nominally whitens the spectrum because of 6 dB per octave
rolloff
Zeros = Close - Close[2] ;
//SuperSmoother Filter
Filt = c1 * ( Zeros + Zeros[1] )
/ 2 + c2 * Filt[1] + c3 * Filt[2] ;
//Compute Standard Deviation
RMS = 0;
For count = 0 to Period - 1
begin
RMS = RMS + Filt[count] * Filt[count] ;
end;
RMS = SquareRoot( RMS / Period ) ;
//Rescale Filt in terms of Standard Deviations
If RMS <> 0 then
ScaledFilt = Filt / RMS ;
//Apply Fisher Transform to establish real Gaussian Probability
//Distribution
If AbsValue( ScaledFilt ) < 2 then
FisherFilt = .5 *
Log( ( 1 + ScaledFilt / 2 ) / ( 1 - ScaledFilt / 2 ) ) ;
Plot1( FisherFilt, "Fisher Filt" ) ;
Plot2( 0, "ZL" ) ;
Plot3( OverBought, "OB" ) ;
Plot4( OverSold, "OS" ) ;
//Bin the indicator values in Bins from -3 to +3
if OutPutData then
begin
For Idx = 1 to 60
begin
J = (Idx - 31) / 10;
K = (Idx - 30) / 10;
If FisherFilt > J and FisherFilt <= K then
Bin[Idx] = Bin[Idx] + 1;
end;
//Output the Bin measurements to a file
once ( LastBarOnChartEx )
begin
FileDelete( FilePath ) ;
For Idx = 1 to 61
begin
FileAppend( FilePath, NumToStr( .1 * ( Idx - 31 ), 1 )
+ "," + NumToStr( Bin[Idx], 0 ) + NewLine ) ;
end;
end ;
end ;
Strategy: Fisherized Deviation Scaled Oscillator
// TASC OCT 2018
// Ehlers FDSA
inputs:
Period( 40 ),
OverBought( 2 ),
OverSold( -2 ),
OutPutData( false ),
FilePath( "C:DataProbabilityDensity.CSV" ) ;
variables:
a1( 0 ), b1( 0 ), c1( 0 ), c2( 0 ),
c3( 0 ), Zeros( 0 ), Filt( 0 ), RMS( 0 ),
count( 0 ), ScaledFilt( 0 ), FisherFilt( 0 ),
Idx( 0 ), J( 0 ), K( 0 ) ;
arrays:
Bin[61](0);
if CurrentBar = 1 Then
//once
begin
//Smooth with a Super Smoother
a1 = expvalue( -1.414 * 3.14159 / ( .5 * Period ) ) ;
b1 = 2 * a1 * Cosine( 1.414 * 180 / ( .5 * Period ) ) ;
c2 = b1 ;
c3 = -a1 * a1 ;
c1 = 1 - c2 - c3 ;
end ;
//Produce Nominal zero mean with zeros in the transfer response
at
//DC and Nyquist with no spectral distortion
//Nominally whitens the spectrum because of 6 dB per octave
rolloff
Zeros = Close - Close[2] ;
//SuperSmoother Filter
Filt = c1 * ( Zeros + Zeros[1] )
/ 2 + c2 * Filt[1] + c3 * Filt[2] ;
//Compute Standard Deviation
RMS = 0;
For count = 0 to Period - 1
begin
RMS = RMS + Filt[count] * Filt[count] ;
end;
RMS = SquareRoot( RMS / Period ) ;
//Rescale Filt in terms of Standard Deviations
If RMS <> 0 then
ScaledFilt = Filt / RMS ;
//Apply Fisher Transform to establish real Gaussian Probability
//Distribution
If AbsValue( ScaledFilt ) < 2 then
FisherFilt = .5 *
Log( ( 1 + ScaledFilt / 2 ) / ( 1 - ScaledFilt / 2 ) ) ;
if FisherFilt crosses below OverBought then
Sell Short next bar at Market
else if FisherFilt crosses over OverSold then
Buy next bar at Market ;
if FisherFilt crosses below 0 then
Sell next bar at Market
else if FisherFilt crosses over 0 then
Buy to Cover next bar at Market ;
답변 1
예스스탁 예스스탁 답변
2018-09-27 10:46:00
안녕하세요
예스스탁입니다
1
1번식만 변경해 드립니다.
다른식은 값을 지정하거나 특정일에 진입하는 내용입니다.
내용을 추가해 드리기 어려우므로 아래식 참고하셔서 수정변환해 사용하시기 바랍니다.
input : 전체자본(10000000),투입가능자본퍼센트(50),손실허용한도퍼센트(1.5),ATR기간(14);
var : 매매단위(0),투입금액(0),ATRV(0);
var1 = highest(H,40);
var2 = Lowest(L,40);
ATRV = atr(ATR기간);
if MarketPosition == 0 and H < var1 Then
{
매매단위 = Floor((전체자본*(손실허용한도퍼센트/100))/(ATRV*BigPointValue));
buy("b",AtStop,var1,매매단위);
}
if MarketPosition == 0 and L > var2 Then
{
매매단위 = Floor((전체자본*(손실허용한도퍼센트/100))/(ATRV*BigPointValue));
sell("s",AtStop,var2,매매단위);
}
if MarketPosition == 1 Then
{
if CurrentContracts > CurrentContracts[1] Then
{
if MaxEntries == 1 Then
투입금액 = CurrentContracts*LatestEntryPrice(0);
if MaxEntries >= 2 Then
투입금액 = 투입금액 + (CurrentContracts-CurrentContracts[1])*LatestEntryPrice(0);
}
if 투입금액 < 전체자본*(투입가능자본퍼센트/100) Then
{
매매단위 = Floor(min((전체자본*손실허용한도퍼센트/100),(전체자본*(투입가능자본퍼센트/100)-투입금액))/(ATRV*BigPointValue));
buy("bb",AtStop,LatestEntryPrice(0)+ATRV*2,매매단위);
}
ExitLong("bx",AtStop,LatestEntryPrice(0)-ATRV*1);
}
if MarketPosition == -1 Then
{
if CurrentContracts > CurrentContracts[1] Then
{
if MaxEntries == 1 Then
투입금액 = CurrentContracts*LatestEntryPrice(0);
if MaxEntries >= 2 Then
투입금액 = 투입금액 + (CurrentContracts-CurrentContracts[1])*LatestEntryPrice(0);
}
if 투입금액 < 전체자본*(투입가능자본퍼센트/100) Then
{
매매단위 = Floor(min((전체자본*손실허용한도퍼센트/100),(전체자본*(투입가능자본퍼센트/100)-투입금액))/(ATRV*BigPointValue));
sell("ss",AtStop,LatestEntryPrice(0)-ATRV*2,매매단위);
}
ExitShort("sx",AtStop,LatestEntryPrice(0)+ATRV*1);
}
2
주식거래를 염두에 둔 수식이라 그대로 파생상품에 적용하시는 어려운 내용입니다.
수량이 굉장히 큰값이므로 증거금으로 계산되는 파생상품과 맞지않아
매매수량단위를 1포인트에 해당하는 환산금액으로 변경해 최대한 수량을 줄였습니다.
파생상품에 사용가능여부는 사용자분이 체크해 보셔야 합니다.
3-1
inputs: Period( 40 ),OverBought( 2 ),OverSold( -2 ),OutPutData( false );
variables:a1( 0 ), b1( 0 ), c1( 0 ), c2( 0 ),
c3( 0 ), Zeros( 0 ), Filt( 0 ), RMS( 0 ),
count( 0 ), ScaledFilt( 0 ), FisherFilt( 0 ),
Idx( 0 ), J( 0 ), K( 0 ) ;
arrays: Bin[61](0);
if CurrentBar == 1 Then
{
a1 = expvalue( -1.414 * 3.14159 / ( .5 * Period ) ) ;
b1 = 2 * a1 * Cosine( 1.414 * 180 / ( .5 * Period ) ) ;
c2 = b1 ;
c3 = -a1 * a1 ;
c1 = 1 - c2 - c3 ;
}
if CurrentBar >= 1 Then
{
Zeros = Close - Close[2] ;
Filt = c1 * ( Zeros + Zeros[1] )/ 2 + c2 * Filt[1] + c3 * Filt[2] ;
RMS = 0;
For count = 0 to Period - 1
begin
RMS = RMS + Filt[count] * Filt[count] ;
end;
RMS = SquareRoot( RMS / Period ) ;
If RMS <> 0 then
ScaledFilt = Filt / RMS ;
If AbsValue( ScaledFilt ) < 2 then
FisherFilt = .5 *Log( ( 1 + ScaledFilt / 2 ) / ( 1 - ScaledFilt / 2 ) ) ;
}
Plot1( FisherFilt, "Fisher Filt" ) ;
Plot2( 0, "ZL" ) ;
Plot3( OverBought, "OB" ) ;
Plot4( OverSold, "OS" ) ;
3-2
inputs: Period( 40 ), OverBought( 2 ), OverSold( -2 );
variables:
a1( 0 ), b1( 0 ), c1( 0 ), c2( 0 ),
c3( 0 ), Zeros( 0 ), Filt( 0 ), RMS( 0 ),
count( 0 ), ScaledFilt( 0 ), FisherFilt( 0 ),
Idx( 0 ), J( 0 ), K( 0 ) ;
arrays: Bin[61](0);
if CurrentBar == 1 Then
begin
a1 = expvalue( -1.414 * 3.14159 / ( .5 * Period ) ) ;
b1 = 2 * a1 * Cosine( 1.414 * 180 / ( .5 * Period ) ) ;
c2 = b1 ;
c3 = -a1 * a1 ;
c1 = 1 - c2 - c3 ;
end ;
if CurrentBar >= 1 Then
{
Zeros = Close - Close[2] ;
Filt = c1 * ( Zeros + Zeros[1] )/ 2 + c2 * Filt[1] + c3 * Filt[2] ;
RMS = 0;
For count = 0 to Period - 1
begin
RMS = RMS + Filt[count] * Filt[count] ;
end;
RMS = SquareRoot( RMS / Period ) ;
If RMS <> 0 then
ScaledFilt = Filt / RMS ;
If AbsValue( ScaledFilt ) < 2 then
FisherFilt = .5 *Log( ( 1 + ScaledFilt / 2 ) / ( 1 - ScaledFilt / 2 ) ) ;
if CrossDown(FisherFilt,OverBought) then
Sell("S",AtMarket);
if crossup(FisherFilt, OverSold) then
Buy("B",AtMarket);
if CrossDown(FisherFilt,0) then
ExitLong("bx",AtMarket);
if crossup(FisherFilt,0) then
ExitShort("sx",AtMarket);
}
즐거운 하루되세요
> 잡다백수 님이 쓴 글입니다.
> 제목 : 문의드립니다.
> 도움주시는 덕분에 도전하고 있습니다. 매번 감사합니다. 즐거운 명절 되세요.
1. 기타
59300 수식(추가답변에 달린 추가진입하는 버전으로) sell도 가능하게 수정 부탁드립니다.
2. 기타
59300수식을 선물에다가도 적용가능한가요?
3.
예스로 수정부탁드립니다.
// Indicator: Fisherized Deviation Scaled Oscillator
inputs:
Period( 40 ),
OverBought( 2 ),
OverSold( -2 ),
OutPutData( false ),
FilePath( "C:ProbabilityDensity.CSV" ) ;
variables:
a1( 0 ), b1( 0 ), c1( 0 ), c2( 0 ),
c3( 0 ), Zeros( 0 ), Filt( 0 ), RMS( 0 ),
count( 0 ), ScaledFilt( 0 ), FisherFilt( 0 ),
Idx( 0 ), J( 0 ), K( 0 ) ;
arrays:
Bin[61](0);
if CurrentBar = 1 Then
//once
begin
//Smooth with a Super Smoother
a1 = expvalue( -1.414 * 3.14159 / ( .5 * Period ) ) ;
b1 = 2 * a1 * Cosine( 1.414 * 180 / ( .5 * Period ) ) ;
c2 = b1 ;
c3 = -a1 * a1 ;
c1 = 1 - c2 - c3 ;
end ;
//Produce Nominal zero mean with zeros in the transfer response
at
//DC and Nyquist with no spectral distortion
//Nominally whitens the spectrum because of 6 dB per octave
rolloff
Zeros = Close - Close[2] ;
//SuperSmoother Filter
Filt = c1 * ( Zeros + Zeros[1] )
/ 2 + c2 * Filt[1] + c3 * Filt[2] ;
//Compute Standard Deviation
RMS = 0;
For count = 0 to Period - 1
begin
RMS = RMS + Filt[count] * Filt[count] ;
end;
RMS = SquareRoot( RMS / Period ) ;
//Rescale Filt in terms of Standard Deviations
If RMS <> 0 then
ScaledFilt = Filt / RMS ;
//Apply Fisher Transform to establish real Gaussian Probability
//Distribution
If AbsValue( ScaledFilt ) < 2 then
FisherFilt = .5 *
Log( ( 1 + ScaledFilt / 2 ) / ( 1 - ScaledFilt / 2 ) ) ;
Plot1( FisherFilt, "Fisher Filt" ) ;
Plot2( 0, "ZL" ) ;
Plot3( OverBought, "OB" ) ;
Plot4( OverSold, "OS" ) ;
//Bin the indicator values in Bins from -3 to +3
if OutPutData then
begin
For Idx = 1 to 60
begin
J = (Idx - 31) / 10;
K = (Idx - 30) / 10;
If FisherFilt > J and FisherFilt <= K then
Bin[Idx] = Bin[Idx] + 1;
end;
//Output the Bin measurements to a file
once ( LastBarOnChartEx )
begin
FileDelete( FilePath ) ;
For Idx = 1 to 61
begin
FileAppend( FilePath, NumToStr( .1 * ( Idx - 31 ), 1 )
+ "," + NumToStr( Bin[Idx], 0 ) + NewLine ) ;
end;
end ;
end ;
Strategy: Fisherized Deviation Scaled Oscillator
// TASC OCT 2018
// Ehlers FDSA
inputs:
Period( 40 ),
OverBought( 2 ),
OverSold( -2 ),
OutPutData( false ),
FilePath( "C:DataProbabilityDensity.CSV" ) ;
variables:
a1( 0 ), b1( 0 ), c1( 0 ), c2( 0 ),
c3( 0 ), Zeros( 0 ), Filt( 0 ), RMS( 0 ),
count( 0 ), ScaledFilt( 0 ), FisherFilt( 0 ),
Idx( 0 ), J( 0 ), K( 0 ) ;
arrays:
Bin[61](0);
if CurrentBar = 1 Then
//once
begin
//Smooth with a Super Smoother
a1 = expvalue( -1.414 * 3.14159 / ( .5 * Period ) ) ;
b1 = 2 * a1 * Cosine( 1.414 * 180 / ( .5 * Period ) ) ;
c2 = b1 ;
c3 = -a1 * a1 ;
c1 = 1 - c2 - c3 ;
end ;
//Produce Nominal zero mean with zeros in the transfer response
at
//DC and Nyquist with no spectral distortion
//Nominally whitens the spectrum because of 6 dB per octave
rolloff
Zeros = Close - Close[2] ;
//SuperSmoother Filter
Filt = c1 * ( Zeros + Zeros[1] )
/ 2 + c2 * Filt[1] + c3 * Filt[2] ;
//Compute Standard Deviation
RMS = 0;
For count = 0 to Period - 1
begin
RMS = RMS + Filt[count] * Filt[count] ;
end;
RMS = SquareRoot( RMS / Period ) ;
//Rescale Filt in terms of Standard Deviations
If RMS <> 0 then
ScaledFilt = Filt / RMS ;
//Apply Fisher Transform to establish real Gaussian Probability
//Distribution
If AbsValue( ScaledFilt ) < 2 then
FisherFilt = .5 *
Log( ( 1 + ScaledFilt / 2 ) / ( 1 - ScaledFilt / 2 ) ) ;
if FisherFilt crosses below OverBought then
Sell Short next bar at Market
else if FisherFilt crosses over OverSold then
Buy next bar at Market ;
if FisherFilt crosses below 0 then
Sell next bar at Market
else if FisherFilt crosses over 0 then
Buy to Cover next bar at Market ;
다음글