예스스탁
예스스탁 답변
2023-01-02 14:57:57
안녕하세요.
예스스탁 입니다.
Input : Profit_Target(20), Stop_Loss(30);
Input : BuyA_ShortLeng(5), BuyA_LongLeng(20), BuyA_SignalLeng(10);
Input : Exit_Len(10);
var : BuyA_Price1(0), BuyA_Price2(0), BuyA_Result(FALSE), SellA_Result(False) ;
var : Vol_check(False) ;
var : C_high(0), C_low(0);
if Volume > 100 Then vol_check = true;
Else vol_check = False;
C_high = Highest(Close, Exit_Len);
C_low = Lowest(Close, Exit_Len);
BuyA_Price1 = MACD(BuyA_ShortLeng, BuyA_LongLeng);
BuyA_Price2 = ema(BuyA_Price1, BuyA_SignalLeng);
BuyA_Result = CrossUp(BuyA_Price1, BuyA_Price2);
SellA_Result = CrossDown(BuyA_Price1 , BuyA_Price2);
if ( BuyA_Result == true And BuyA_Price1 < 0 And vol_check == True ) Then
{
ExitShort("") ;
Buy("Buy",atmarket);
}
if ( SellA_Result == true And BuyA_Price1 > 0 And vol_check == True ) Then
{
ExitLong("") ;
Sell("Sell",atmarket);
}
if c < c_low[1] Then ExitLong("",atmarket );
if c > c_high[1] Then ExitShort("",atmarket);
Var : TickSize(0);
TickSize = PriceScale;
SetStopProfitTarget( Profit_Target * TickSize, pointstop );
SetStopLoss( Stop_Loss * TickSize, pointstop );
즐거운 하루 보내세요.
> 바둑이 님이 쓴 글입니다.
> 제목 : 예스랭귀지로 변환 부탁드립니다.
> Params :
Profit_Target( 20 ),
Stop_Loss( 30 );
param : BuyA_ShortLeng(5)
, BuyA_LongLeng(20)
, BuyA_SignalLeng(10)
;
param : Exit_Len(10);
var : BuyA_Price1(0), BuyA_Price2(0), BuyA_Result(FALSE), SellA_Result(False) ;
var : Vol_check(False) ;
var : C_high(0), C_low(0);
if Volume > 100 Then
vol_check = true
Else
vol_check = False
;
C_high = Highest(Close, Exit_Len);
C_low = Lowest(Close, Exit_Len);
BuyA_Price1 = MACD(Close, BuyA_ShortLeng, BuyA_LongLeng);
BuyA_Price2 = ema(MACD(Close, BuyA_ShortLeng, BuyA_LongLeng), BuyA_SignalLeng);
BuyA_Result = CrossUp(BuyA_Price1, BuyA_Price2);
SellA_Result = CrossDown(BuyA_Price1 , BuyA_Price2);
if ( BuyA_Result = true And BuyA_Price1 < 0 And vol_check = True )
Then
Begin
ExitShort("") ;
Buy("Buy",atmarket);
End;
if ( SellA_Result = true And BuyA_Price1 > 0 And vol_check = True )
Then
Begin
ExitLong("") ;
Sell("Sell",atmarket);
End;
if c < c_low[1] Then
Begin
ExitLong("",atmarket ) ;
End;
if c > c_high[1] Then
Begin
ExitShort("",atmarket) ;
End;
Var : TickSize( 0 );
TickSize = OneTick * PriceScale;
SetStopProfitTarget( Profit_Target * TickSize );
SetStopLoss( Stop_Loss * TickSize );