답변완료
문의드립니다.
안녕하세요.
아래 수식에서
매수 포지션시 100틱 이상 이익이 나면 그 때부터 분봉의 저가가
20 이평선값 아래로 터치하면 청산 되도록 수정을 부탁드립니다.
input : StartTime(230000),EndTime(053000);
var : Tcond(false);
if (sdate != sdate[1] and stime >= StartTime) or
(sdate == sdate[1] and stime >= StartTime and stime[1] < StartTime) Then
{
Tcond = true;
}
if (sdate != sdate[1] and stime >= EndTime) or
(sdate == sdate[1] and stime >= EndTime and stime[1] < EndTime) Then
{
Tcond = False;
}
var1 = ma(C,5);
Var2 = ma(C,20);
if MarketPosition <= 0 and CrossUp(var1,Var2) and Tcond == true Then
{
buy("b",OnClose,Def,4);
}
if MarketPosition == 1 Then
{
if MaxEntries == CurrentContracts Then
ExitLong("bx11",AtStop,EntryPrice+PriceScale*20,"",2,1);
Else
ExitLong("bx12",AtStop,EntryPrice);
ExitLong("bx2",AtStop,L[BarsSinceEntry]);
if crossdown(C , Var2) Then
ExitLong("bx3");
}
즐거운 하루되세요
> 종호 님이 쓴 글입니다.
> 제목 : 문의드립니다.
>
아래수식을 나스닥 선물에 적용해서 오후 11시 부터 다음 날 아침 5시 30분까지만
매수진입이 되게 하고 싶습니다.
진입만 이렇게 시간제한을 두고요 . 창산은 24시간 다 작동하도록 부탁드립니다.
var1 = ma(C,5);
Var2 = ma(C,20);
if MarketPosition <= 0 and CrossUp(var1,Var2) Then
{
buy("b",OnClose,Def,4);
}
if MarketPosition == 1 Then
{
if MaxEntries == CurrentContracts Then
ExitLong("bx11",AtStop,EntryPrice+PriceScale*20,"",2,1);
Else
ExitLong("bx12",AtStop,EntryPrice);
ExitLong("bx2",AtStop,L[BarsSinceEntry]);
if crossdown(C , Var2) Then
ExitLong("bx3");
2023-10-18
939
글번호 173194
시스템
답변완료
문의 드립니다!
안녕하세요!
1, 아래수식을 국선챠트에 적용시 가로선의 발생시점이...
2~3개의 캔들이 발생후에 늦게 나타나는데...
이것을 해당캔들의 완성과 동시에 바로 발생토록 할려면 어떤 설정을 수정해야할지 문의드립니다
2, 동시에 가로선 발생시 세로선과 알람신호도 발생토록 수정 부탁드립니다
감사합니다!!!
---------------------------------------------------
input : af(0.2), maxAF(0.2);
input : 텍스트출력(0),선굵기(2);
var : T(0),cnt(0),count(0);
var : HH1(0),LL1(0),HD1(0),HT1(0),LD1(0),LT1(0),day1(0),day0(0),TL3(0);
var : TL1(0),TL2(0),tx1(0),tx2(0),tx11(0),tx22(0),idx(0),tx99(0),tx88(0);
Array : HD[20](0),HT[20](0),HH[20](0),LD[20](0),LT[20](0),LL[20](0);
Array : HI[20](0),LI[20](0);
var1 = CSar(af,maxAF);
if bdate != bdate[1] Then
{
day0 = sdate;
day1 = day0[1];
}
if crossup(c,var1) Then
{
T = 1;
HH[0] = H;
HD[0] = sdate;
HT[0] = stime;
HI[0] = index;
for cnt = 1 to 19
{
HD[cnt] = HD[cnt-1][1];
HT[cnt] = HT[cnt-1][1];
HH[cnt] = HH[cnt-1][1];
HI[cnt] = HI[cnt-1][1];
}
if LL[0] > 0 Then
{
Condition1 = false;
for cnt = 1 to 19
{
if Condition1 == false and abs(LL[0]-LL[cnt]) <= PriceScale*1 and LD[cnt] >= day1 Then
{
Condition1 = true;
TL1 = TL_New(LD[cnt],LT[cnt],LL[cnt],LD[0],LT[0],LL[0]);
TL_SetSize(TL1,선굵기);
TL_SetColor(TL1,black);
idx = abs(LI[0]-LI[cnt]);
//tx99 = Text_New(LD[0],LT[0],LL[0],NumToStr(idx,0));
Text_SetColor(tx99,black);
Text_SetStyle(tx99,0,3);
Text_SetBold(tx99,2);
}
}
}
}
if CrossDown(c,var1) Then
{
T = -1;
LL[0] = L;
LD[0] = sdate;
LT[0] = stime;
LI[0] = index;
for cnt = 1 to 19
{
LD[cnt] = LD[cnt-1][1];
LT[cnt] = LT[cnt-1][1];
LL[cnt] = LL[cnt-1][1];
LI[cnt] = LI[cnt-1][1];
}
if HH[0] > 0 Then
{
Condition2 = false;
for cnt = 1 to 19
{
if Condition2 == false and abs(HH[0]-HH[cnt]) <= PriceScale*1 and HD[cnt] >= day1 Then
{
Condition2 = true;
TL2 = TL_New(HD[cnt],HT[cnt],HH[cnt],HD[0],HT[0],HH[0]);
TL_SetSize(TL2,선굵기);
TL_SetColor(TL2,black);
idx = abs(HI[0]-HI[cnt]);
//tx99 = Text_New(HD[0],HT[0],HH[0],NumToStr(idx,0));
Text_SetColor(tx99,black);
Text_SetStyle(tx99,0,3);
Text_SetBold(tx99,2);
}
}
}
}
if T == 1 then
{
if H > HH[0] Then
{
HH[0] = H;
HD[0] = sdate;
HT[0] = stime;
if Condition3 == false and abs(HH[0]-HH[cnt]) <= PriceScale*1 and HD[cnt] >= day1 Then
{
Condition3 = true;
TL3 = TL_New(HD[cnt],HT[cnt],HH[cnt],HD[0],HT[0],HH[0]);
TL_SetSize(TL3,선굵기);
TL_SetColor(TL3,black);
idx = abs(HI[0]-HI[cnt]);
//tx88 = Text_New(HD[0],HT[0],HH[0],NumToStr(idx,0));
Text_SetColor(tx88,black);
Text_SetStyle(tx88,0,3);
Text_SetBold(tx88,2);
}
}
}
if T == -1 then
{
if L < LL[0] Then
{
LL[0] = L;
LD[0] = sdate;
LT[0] = stime;
if Condition3 == false and abs(LL[0]-LL[cnt]) <= PriceScale*1 and LD[cnt] >= day1 Then
{
Condition3 = true;
TL3 = TL_New(LD[cnt],LT[cnt],LL[cnt],LD[0],LT[0],LL[0]);
TL_SetSize(TL3,선굵기);
TL_SetColor(TL3,black);
idx = abs(LI[0]-LI[cnt]);
//tx88 = Text_New(LD[0],LT[0],LL[0],NumToStr(idx,0));
Text_SetColor(tx88,black);
Text_SetStyle(tx88,0,3);
Text_SetBold(tx88,2);
}
}
}
2023-10-18
651
글번호 173179
지표