답변완료
수식 부탁드립니다
If MarketPosition==1 Then
{
SetStopLoss( 2*ATr(20),PointStop );
}
If MarketPosition==1 and c < c[1]*0.75 Then
{
ExitLong( "급락", OnClose, Def );
}
If MarketPosition==1 Then
{
ExitLong( "급락", atstop, c[1]*0.75 );
}
1번 강제청산
2번 종가 청산
3번 실시간 청산
위 청산식들이, 오후3시10분 이후에만 작동되도록 하려면 어떻게 해야할까요?
stime을 사용하면 될 것 같은데.. 예시 삼아 한번 부탁드리겠습니다 ㅠ
2023-03-16
1274
글번호 167232
지표
답변완료
문의드립니다
Input : 하락폭(16), 상승폭(70), 손절값(0);
input : StartTime(70000),EndTime(60000);
var : Tcond(false);
IF Endtime > starttime Then
SetStopEndofday(Endtime);
Else
{
if sDate != sDate[1] Then
SetStopEndofday(Endtime);
}
if (sdate != sdate[1] and stime >= EndTime) or
(sdate == sdate[1] and stime >= EndTime and stime[1] < EndTime) Then
Tcond = False;
if (sdate != sdate[1] and stime >= StartTime) or
(sdate == sdate[1] and stime >= StartTime and stime[1] < StartTime) Then
{
Tcond = true;
IF Endtime <= starttime Then
{
SetStopEndofday(0);
}
}
Var : Entry(0);
if Bdate != Bdate[1] Then
{
Entry = 0;
}
if (MarketPosition != 0 and MarketPosition != MarketPosition[1]) or
(MarketPosition == MarketPosition[1] and TotalTrades > TotalTrades[1]) Then
Entry = Entry + 2;
if MarketPosition == 0 and Entry < 2 Then
{
if Bdate != NextBarSdate Then
Buy("B1",AtLimit,NextBarOpen-(PriceScale*하락폭));
Else if Bdate == Bdate[1] Then
Buy("B2",AtLimit,DayOpen-(PriceScale*하락폭));
}
SetStopProfittarget(PriceScale*상승폭,PointStop);
SetStopLoss(PriceScale*손절값,PointStop);
위 수식어를 진입 2회로 부탁드립니다.
미리 감사드립니다.
2023-03-16
993
글번호 167226
시스템
답변완료
쌍쓰리 동시
input : Period(120);
Var:j(0),T(0);
Var: date11(0),date12(0),time11(0),time12(0),
date21(0),date22(0),time21(0),time22(0),
date31(0),date32(0),time31(0),time32(0);
Array: HiVal[20](0),LoVal[20](0),HiBar[20](0),LoBar[20](0);
var : tx1(0),tx2(0),tx3(0),tx4(0);
var : tx99(0),tx99count(0),l1(0),l2(0),l3(0),l4(0);
Plot1(value12);
For j = 0 To 19
{
HiBar[j] = HiBar[j] + 1;
LoBar[j] = LoBar[j] + 1;
}
if crossup(c,highest(H,Period)[1]) Then
T = 1;
if CrossDown(c,Lowest(L,Period)[1]) Then
T = -1;
If T == -1 Then
{
If T[1] != -1 Then
{
For j = 18 DownTo 0
{
LoVal[j+1] = LoVal[j];
LoBar[j+1] = LoBar[j];
}
LoVal[0] = L;
LoBar[0] = 0;
date11 = date[HiBar[0]];
time11 = stime[HiBar[0]];
Value11 = HiVal[0];
date12 = date[LoBar[0]];
time12 = stime[LoBar[0]];
Value12 = LoVal[0];
date21 = date[HiBar[0]];
time21 = stime[HiBar[0]];
date22 = date[0];
time22 = stime[0];
Condition99 = False;
tx99count = 0;
}
Else
{
If LoVal[0] >= L Then
{
LoVal[0] = L;
LoBar[0] = 0;
date12 = date[LoBar[0]];
time12 = stime[LoBar[0]];
Value12 = LoVal[0];
date22 = date[0];
time22 = stime[0];
Condition99 = False;
}
Else
{
if Condition99 == False and value12 <= value11-0.5 and H >= value12+PriceScale*3 Then
{
Condition99 = true;
l1 = value12;
l2 = l1[1];
l3 = l2[1];
l4 = l3[1];
tx99count = tx99count+1;
if tx99count >= 2 Then
{
if max(L1,L2) <= min(L1,L2)+PriceScale*2 Then
{
tx2 = Text_New(date12,time12,L1-PriceScale*0,"●");
Text_SetStyle(tx2,2,2);
Text_SetColor(tx2,Cyan);
Text_SetSize(tx2,30);
}
}
if tx99count >= 3 Then
{
if max(L1,L2,L3) <= min(L1,L2,L3)+PriceScale*5 Then
{
tx3 = Text_New(date12,time12,L1-PriceScale*0,"●");
Text_SetStyle(tx3,2,2);
Text_SetColor(tx3,Black);
Text_SetSize(tx3,25);
}
}
}
}
}
}
If T == 1 Then
{
If T[1] != 1 Then
{
For j = 18 DownTo 0
{
HiVal[j+1] = HiVal[j];
HiBar[j+1] = HiBar[j];
}
HiVal[0] = H;
HiBar[0] = 0;
date11 = date[LoBar[0]];
time11 = stime[LoBar[0]];
Value11 = LoVal[0];
date12 = date[HiBar[0]];
time12 = stime[HiBar[0]];
Value12 = HiVal[0];
date31 = date[LoBar[0]];
time31 = stime[LoBar[0]];
date32 = date[0];
time32 = stime[0];
}
If HiVal[0] < H Then
{
HiVal[0] = H;
HiBar[0] = 0;
date12 = date[HiBar[0]];
time12 = stime[HiBar[0]];
Value12 = HiVal[0];
date32 = date[0];
time32 = stime[0];
}
}
2틱 이내 쌍반등과 5틱 이내 쓰리반등이 동시 발생시 동그라미 따로 추가. 부탁드립니다.
(두 수식의 동그라미가 겹치는, 쌍반등이면서 쓰리반등인 부분에 동그라미 따로 추가)
2023-03-16
1187
글번호 167221
지표