답변완료
지표
항상감사합니다.
1]챠트에 시간표시 부탁드립니다
5분봉챠트라면
5분시가에서 종가까지 시간이 현재봉위치오른쪽에 표시 부탁드립니다.
시,분,초
2]위아래 저점에서 고점까지가격은 표시됩니다.
1.25부터~8.75까지 가격표시도 될까요
저점)0+1.25
2.5
3.75
5.00
6.25
7.50
8.75
고점)100
input:length(10),글자크기(8);
Var:j(0),lastHiVal(0),lastLoVal(0),sBar(0),eBar(0),TL1(0),
Text1(0),처리구분("");
Array:고점[10,2](0),저점[10,2](0); //가격,위치
처리구분 = "";
If Highest(H,length) == H and lastHiVal <> H and
Lowest(L,length) == L and lastLoVal <> L Then
{
If 저점[1,1] > L Then 처리구분 = "저점처리";
If 고점[1,1] < H Then 처리구분 = "고점처리";
}
Else If Highest(H,length) == H and lastHiVal <> H Then
처리구분 = "고점처리";
Else If Lowest(L,length) == L and lastLoVal <> L Then
처리구분 = "저점처리";
If 처리구분 == "고점처리" Then
{
lastHiVal = H;
If 고점[1,2] < 저점[1,2] Then
{
For j = 10 DownTo 2
{
고점[j,1] = 고점[j-1,1];
고점[j,2] = 고점[j-1,2];
}
}
If 고점[1,2] < 저점[1,2] or 고점[1,1] < H Then
{
고점[1,1] = H;
고점[1,2] = Index;
sBar = Index - 저점[1,2];
eBar = 0;
If TL_GetBeginDate(TL1) == sDate[sBar] and
TL_GetBeginTime(TL1) == sTime[sBar] Then
{
TL_Delete(TL1);
Text_Delete(Text1);
}
TL1 = TL_New(sDate[sBar],sTime[sBar],저점[1,1],
sDate[eBar],sTime[eBar],고점[1,1]);
Text1 = Text_New(sDate[eBar],sTime[eBar],고점[1,1],NumToStr(고점[1,1],2)+NewLine+NumToStr((고점[1,1]-저점[1,1]),2));
Text_SetStyle(Text1, 2, 1);
Text_SetSize(text1,글자크기);
}
}
If 처리구분 == "저점처리" Then
{
lastLoVal = L;
If 저점[1,2] < 고점[1,2] then
{
For j = 10 DownTo 2
{
저점[j,1] = 저점[j-1,1];
저점[j,2] = 저점[j-1,2];
}
}
If 저점[1,2] < 고점[1,2] or 저점[1,1] > L then
{
저점[1,1] = L;
저점[1,2] = Index;
sBar = Index - 고점[1,2];
eBar = 0;
If TL_GetBeginDate(TL1) == sDate[sBar] and
TL_GetBeginTime(TL1) == sTime[sBar] Then
{
TL_Delete(TL1);
Text_Delete(Text1);
}
TL1 = TL_New(sDate[sBar],sTime[sBar],고점[1,1],
sDate[eBar],sTime[eBar],저점[1,1]);
Text1 = Text_New(sDate[eBar],sTime[eBar],저점[1,1],NumToStr(저점[1,1],2)+NewLine+NumToStr((고점[1,1]-저점[1,1]),2));
Text_SetStyle(Text1, 2, 0);
Text_SetSize(text1,글자크기);
}
}
TL_SetSize(TL1,3);
TL_SetColor(TL1,Yellow);
2023-01-01
882
글번호 164986
지표
답변완료
예스랭귀지로 변환 부탁드립니다.
Params :
Profit_Target( 90 ),
Stop_Loss( 40 );
param : BuyA_iLen(20) ,
ExitLongA_iLen(15),
SellA_iLen(20),
ExitShortA_iLen(15);
param : BuyA_ChoiceType(0),
ExitLongA_ChoiceType(1) ;
param : SellA_ChoiceType(1) ,
ExitShortA_ChoiceType(0);
param : Margin(0.00) , cut_amt(1), loss_limit(-100); // cut_amt
param : Time_start(160000) , time_end(050000), time_exit1(051000) ;
var : time_now(0) , Trading_time(False), all_exit(False) , Daily_vari(False),
Buy_ok(False) , Sell_ok(False) ;
var : yesterday_low(0) , yesterday_high(0) ;
var : today_low(0) , today_high(0) ;
var : yesterday_close(0) ;
var : check_01(0), check_02(0),check_03(0),check_04(0),check_05(0);
Var : TickSize( 0 );
TickSize = OneTick * PriceScale;
//////////////////////////////////////////////////////////////////////////
// 매수진입 [BuyA : 종가봉 20 갱신, ]
//////////////////////////////////////////////////////////////////////////
var : BuyA_V1(0), BuyA_V2(0), BuyA_Result(FALSE);
BuyA_V1 = Highest(High, BuyA_iLen);
BuyA_V2 = Lowest(Low, BuyA_iLen);
BuyA_Result = Close > BuyA_V1[1];
if ( BuyA_Result = true )
Then
Buy("Buy");
//////////////////////////////////////////////////////////////////////////
// 매수청산 [ExitLongA : 종가봉 15 갱신, ]
//////////////////////////////////////////////////////////////////////////
var : ExitLongA_V1(0), ExitLongA_V2(0), ExitLongA_Result(FALSE);
ExitLongA_V1 = Highest(High, ExitLongA_iLen);
ExitLongA_V2 = Lowest(Low, ExitLongA_iLen);
ExitLongA_Result = Close < ExitLongA_V2[1];
if ( ExitLongA_Result = true )
Then
ExitLong("");
//////////////////////////////////////////////////////////////////////////
// 매도진입 [SellA : 종가봉 20 갱신, ]
//////////////////////////////////////////////////////////////////////////
var : SellA_V1(0), SellA_V2(0), SellA_Result(FALSE);
SellA_V1 = Highest(High, SellA_iLen);
SellA_V2 = Lowest(Low, SellA_iLen);
SellA_Result = Close < SellA_V2[1];
if ( SellA_Result = true ) Then
Sell("Sell");
//////////////////////////////////////////////////////////////////////////
// 매도청산 [ExitShortA : 종가봉 15 갱신, ]
//////////////////////////////////////////////////////////////////////////
var : ExitShortA_V1(0), ExitShortA_V2(0), ExitShortA_Result(FALSE);
ExitShortA_V1 = Highest(High, ExitShortA_iLen);
ExitShortA_V2 = Lowest(Low, ExitShortA_iLen);
ExitShortA_Result = FALSE;
ExitShortA_Result = Close > ExitShortA_V1[1];
if ( ExitShortA_Result = true )
Then
ExitShort("");
SetStopProfitTarget( Profit_Target * TickSize );
SetStopLoss( Stop_Loss * TickSize );
2023-01-01
841
글번호 164983
시스템
답변완료
예스랭귀지로 변환 부탁드립니다.
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 );
2023-01-01
678
글번호 164980
시스템