커뮤니티
문의드립니다.
2018-02-06 09:16:55
206
글번호 116343
도움주시는 덕분에 도전하고 있습니다.매번 감사합니다.
1. 기타
트레이스테이션 코드 예스로 수정 부탁드립니다.
Indicator: CAM
// TASC JAN 2018
// The CAM Indicator
// Barbara Star, PhD.
inputs:
ADXLength( 10 ),
MACDFastLength( 12 ),
MACDSlowLength( 26 ),
CAMUPColor( Green ),
CAMDNColor( Red ),
CAMPBColor( Yellow ),
CAMCTColor( Blue ) ;
variables:
MACDValue( 0 ),
ADXValue( 0 ),
PlotColor( 0 ),
MACDRising( false ),
ADXRising( false ),
intrabarpersist InAChart( false ),
PatternLabel( "" ) ;
once
begin
InAChart = GetAppInfo( aiApplicationType ) = cChart ;
end ;
MACDValue = MACD( Close, MACDFastLength,
MACDSlowLength ) ;
ADXValue = ADX( ADXLength ) ;
MACDRising = MACDValue > MACDValue[1] ;
ADXRising = ADXValue > ADXValue[1] ;
if ADXRising and MACDRising then
begin
PlotColor = CAMUPColor ;
PatternLabel = "CAM UP" ;
end
else if not ADXRising and not MACDRising then
begin
PlotColor = CAMPBColor ;
PatternLabel = "CAM PB" ;
end
else if ADXRising and not MACDRising then
begin
PlotColor = CAMDNColor ;
PatternLabel = "CAM DN" ;
end
else if not ADXRising and MACDRising then
begin
PlotColor = CAMCTColor ;
PatternLabel = "CAM CT" ;
End ;
// Format plot style as follows:
// Plot1 Bar High
// Plot2 Bar Low
// Plot3 Left Tic
// Plot4 Right Tic
Plot1( High, "CAMH", PlotColor ) ;
Plot2( Low, "CAML", PlotColor ) ;
Plot3( Open, "CAMO", PlotColor ) ;
Plot4( Close, "CAMC", PlotColor ) ;
// Show current state in RadarScreen
If not InAChart then
Plot5( PatternLabel, "CAM", PlotColor )
2. 기타
트레이스테이션 코드 예스로 수정 부탁드립니다.
inputs:
ChanLength( 20 ),
StopDollars( 1 ),
MALength( 50 ) ;
variables:
UpperBand( 0 ),
LowerBand( 0 ),
MidBand( 0 ),
LongOK( false ),
ShortOK( false ),
LowRef( 0 ),
HighRef( 0 ),
TriggerLine( 0 ),
MAValue( 0 ) ;
UpperBand = Highest( High, ChanLength ) ;
LowerBand = Lowest( Low, ChanLength ) ;
MAValue = Average( Close, MALength ) ;
if Low = LowerBand then
begin
LowRef = Low ;
LongOK = false ;
ShortOK = true ;
end ;
if High = UpperBand then
begin
HighRef = High ;
LongOK = true ;
ShortOK = false ;
end ;
// 50% Pull Back Level
TriggerLine = .5 * ( HighRef + LowRef ) ;
if LongOK[1] and LongOK
and Close crosses over TriggerLine
and Close > MAValue
and MarketPosition( 1 ) < 1 then
begin
Buy next bar at Market ;
LongOK = false ;
end
else if ShortOK[1] and ShortOK
and Close crosses under TriggerLine
and Close < MAValue
and MarketPosition( 1 ) > -1 then
begin
SellShort next bar at Market ;
ShortOK = false ;
end ;
Sell next bar at Upperband Limit ;
Sell next bar at Lowerband Stop ;
Buy to Cover next bar at Lowerband Limit ;
Buy to Cover next bar at UpperBand Stop ;
SetStopShare ;
SetStopLoss( StopDollars ) ;
Indicator: MeanReversion
inputs:
ChanLength( 20 ),
MALength( 50 ) ;
variables:
UpperBand( 0 ),
LowerBand( 0 ),
MidBand( 0 ),
LongOK( false ),
ShortOK( false ),
LowRef( 0 ),
HighRef( 0 ),
TriggerLine( 0 ),
MAValue( 0 ) ;
UpperBand = Highest( High, ChanLength ) ;
LowerBand = Lowest( Low, ChanLength ) ;
MAValue = Average( Close, MALength ) ;
if Low = LowerBand then
begin
LowRef = Low ;
LongOK = false ;
ShortOK = true ;
end ;
if High = UpperBand then
begin
HighRef = High ;
LongOK = true ;
ShortOK = false ;
end ;
TriggerLine = .5 * ( HighRef + LowRef ) ;
Plot1( UpperBand, "UpperBand" ) ;
Plot2( LowerBand, "LowerBand" ) ;
Plot3( TriggerLine, "Trigger" ) ;
Plot4( MAValue, "Mov Avg" ) ;
if LongOK then
begin
SetPlotColor( 1, Green ) ;
SetPlotColor( 2, Green ) ;
end
else
begin
SetPlotColor( 1, Red ) ;
SetPlotColor( 2, Red ) ;
end ;
답변 1
예스스탁 예스스탁 답변
2018-02-06 13:58:02
안녕하세요
예스스탁입니다.
1
Indicator: CAM
위 지표는 가능하지 않스비다.
수식 냉에 어떤 기능인지 모르는 내용이 많습니다.
2
inputs: ChanLength( 20 ), StopDollars( 1 ), MALength( 50 ) ;
variables: UpperBand( 0 ), LowerBand( 0 ), MidBand( 0 ), LongOK( false ), ShortOK( false ),
LowRef( 0 ), HighRef( 0 ), TriggerLine( 0 ), MAValue( 0 ) ;
UpperBand = Highest( High, ChanLength ) ;
LowerBand = Lowest( Low, ChanLength ) ;
MAValue = Ma( Close, MALength ) ;
if Low == LowerBand then
begin
LowRef = Low ;
LongOK = false ;
ShortOK = true ;
end ;
if High == UpperBand then
begin
HighRef = High ;
LongOK = true ;
ShortOK = false ;
end;
// 50% Pull Back Level
TriggerLine = .5 * ( HighRef + LowRef ) ;
if LongOK[1] and LongOK
and crossup(c, TriggerLine)
and Close > MAValue
and MarketPosition(1) < 1 then
begin
Buy("b",AtMarket);
LongOK = false ;
end;
if ShortOK[1] and ShortOK
and CrossDown(Close,TriggerLine)
and Close < MAValue
and MarketPosition( 1 ) > -1 then
begin
Sell("s",atmarket);
ShortOK = false ;
end;
if MarketPosition == 1 then{
ExitLong("bx1",atlimit,Upperband);
ExitLong("bx2",AtStop,Lowerband);
}
if MarketPosition == -1 then{
ExitShort("sx1",atlimit,Lowerband);
ExitLong("sx",AtStop,UpperBand);
}
SetStopLoss( StopDollars,PointStop ) ;
3
#Indicator: MeanReversion
inputs: ChanLength( 20 ),MALength( 50 ) ;
variables: UpperBand( 0 ),LowerBand( 0 ),MidBand( 0 ),LongOK( false ),ShortOK( false ),
LowRef( 0 ),HighRef( 0 ),TriggerLine( 0 ),MAValue( 0 ) ;
UpperBand = Highest( High, ChanLength ) ;
LowerBand = Lowest( Low, ChanLength ) ;
MAValue = Ma( Close, MALength ) ;
if Low == LowerBand then
begin
LowRef = Low ;
LongOK = false ;
ShortOK = true ;
end ;
if High == UpperBand then
begin
HighRef = High ;
LongOK = true ;
ShortOK = false ;
end ;
TriggerLine = .5 * ( HighRef + LowRef ) ;
Plot1( UpperBand, "UpperBand",iff(LongOK,GREEN,red));
Plot2( LowerBand, "LowerBand",iff(LongOK,GREEN,red));
Plot3( TriggerLine, "Trigger");
Plot4( MAValue, "Mov Avg");
즐거운 하루되세요
> 잡다백수 님이 쓴 글입니다.
> 제목 : 문의드립니다.
> 도움주시는 덕분에 도전하고 있습니다.매번 감사합니다.
1. 기타
트레이스테이션 코드 예스로 수정 부탁드립니다.
Indicator: CAM
// TASC JAN 2018
// The CAM Indicator
// Barbara Star, PhD.
inputs:
ADXLength( 10 ),
MACDFastLength( 12 ),
MACDSlowLength( 26 ),
CAMUPColor( Green ),
CAMDNColor( Red ),
CAMPBColor( Yellow ),
CAMCTColor( Blue ) ;
variables:
MACDValue( 0 ),
ADXValue( 0 ),
PlotColor( 0 ),
MACDRising( false ),
ADXRising( false ),
intrabarpersist InAChart( false ),
PatternLabel( "" ) ;
once
begin
InAChart = GetAppInfo( aiApplicationType ) = cChart ;
end ;
MACDValue = MACD( Close, MACDFastLength,
MACDSlowLength ) ;
ADXValue = ADX( ADXLength ) ;
MACDRising = MACDValue > MACDValue[1] ;
ADXRising = ADXValue > ADXValue[1] ;
if ADXRising and MACDRising then
begin
PlotColor = CAMUPColor ;
PatternLabel = "CAM UP" ;
end
else if not ADXRising and not MACDRising then
begin
PlotColor = CAMPBColor ;
PatternLabel = "CAM PB" ;
end
else if ADXRising and not MACDRising then
begin
PlotColor = CAMDNColor ;
PatternLabel = "CAM DN" ;
end
else if not ADXRising and MACDRising then
begin
PlotColor = CAMCTColor ;
PatternLabel = "CAM CT" ;
End ;
// Format plot style as follows:
// Plot1 Bar High
// Plot2 Bar Low
// Plot3 Left Tic
// Plot4 Right Tic
Plot1( High, "CAMH", PlotColor ) ;
Plot2( Low, "CAML", PlotColor ) ;
Plot3( Open, "CAMO", PlotColor ) ;
Plot4( Close, "CAMC", PlotColor ) ;
// Show current state in RadarScreen
If not InAChart then
Plot5( PatternLabel, "CAM", PlotColor )
2. 기타
트레이스테이션 코드 예스로 수정 부탁드립니다.
inputs:
ChanLength( 20 ),
StopDollars( 1 ),
MALength( 50 ) ;
variables:
UpperBand( 0 ),
LowerBand( 0 ),
MidBand( 0 ),
LongOK( false ),
ShortOK( false ),
LowRef( 0 ),
HighRef( 0 ),
TriggerLine( 0 ),
MAValue( 0 ) ;
UpperBand = Highest( High, ChanLength ) ;
LowerBand = Lowest( Low, ChanLength ) ;
MAValue = Average( Close, MALength ) ;
if Low = LowerBand then
begin
LowRef = Low ;
LongOK = false ;
ShortOK = true ;
end ;
if High = UpperBand then
begin
HighRef = High ;
LongOK = true ;
ShortOK = false ;
end ;
// 50% Pull Back Level
TriggerLine = .5 * ( HighRef + LowRef ) ;
if LongOK[1] and LongOK
and Close crosses over TriggerLine
and Close > MAValue
and MarketPosition( 1 ) < 1 then
begin
Buy next bar at Market ;
LongOK = false ;
end
else if ShortOK[1] and ShortOK
and Close crosses under TriggerLine
and Close < MAValue
and MarketPosition( 1 ) > -1 then
begin
SellShort next bar at Market ;
ShortOK = false ;
end ;
Sell next bar at Upperband Limit ;
Sell next bar at Lowerband Stop ;
Buy to Cover next bar at Lowerband Limit ;
Buy to Cover next bar at UpperBand Stop ;
SetStopShare ;
SetStopLoss( StopDollars ) ;
Indicator: MeanReversion
inputs:
ChanLength( 20 ),
MALength( 50 ) ;
variables:
UpperBand( 0 ),
LowerBand( 0 ),
MidBand( 0 ),
LongOK( false ),
ShortOK( false ),
LowRef( 0 ),
HighRef( 0 ),
TriggerLine( 0 ),
MAValue( 0 ) ;
UpperBand = Highest( High, ChanLength ) ;
LowerBand = Lowest( Low, ChanLength ) ;
MAValue = Average( Close, MALength ) ;
if Low = LowerBand then
begin
LowRef = Low ;
LongOK = false ;
ShortOK = true ;
end ;
if High = UpperBand then
begin
HighRef = High ;
LongOK = true ;
ShortOK = false ;
end ;
TriggerLine = .5 * ( HighRef + LowRef ) ;
Plot1( UpperBand, "UpperBand" ) ;
Plot2( LowerBand, "LowerBand" ) ;
Plot3( TriggerLine, "Trigger" ) ;
Plot4( MAValue, "Mov Avg" ) ;
if LongOK then
begin
SetPlotColor( 1, Green ) ;
SetPlotColor( 2, Green ) ;
end
else
begin
SetPlotColor( 1, Red ) ;
SetPlotColor( 2, Red ) ;
end ;