답변완료
매도신호는 나오나 수량이 0으로 나옵니다
모의투자입니다
매도 신호는 나오나 매도주문이 실행되지 않습니다
수정 부탁드립니다
피라미딩 설정- 다른 진입 신호만 허용
고정자산 기준 진입
으로 설정하였습니다 감사합니다
input : 금액(10000000), 일차(0), 이차(0), 삼차(0), 사차(0),오차(0),육차(0),칠차(0),팔차(0),구차(0),십차(0),십일차(0),십이차(0),십삼차(0),십사차(0),십오차(0),십육차(0),십칠차(0),십팔차(0),십구차(0),이십차(0), 손절(0), 프로(99), 날짜(20240822);
var: PP(99999999999),count(0);
if Bdate != Bdate[1] Then
count = 0;
PP = lowest(L,900)*프로 + lowest(L,900);
if sDate > 날짜 Then
if MarketPosition == 0 and Low <= 일차 and count == 0 Then
buy("b1");
if MarketPosition == 1 Then{
if MaxEntries == 1 and Low <= 이차 Then
buy("b2");
if MaxEntries == 2 and Low <= 삼차 Then
buy("b3");
if MaxEntries == 3 and Low <= 사차 Then
buy("b4");
if MaxEntries == 4 and Low <= 오차 Then
buy("b5");
if MaxEntries == 5 and Low <= 육차 Then
buy("b6");
if MaxEntries == 6 and Low <= 칠차 Then
buy("b7");
if MaxEntries == 7 and Low <= 팔차 Then
buy("b8");
if MaxEntries == 8 and Low <= 구차 Then
buy("b9");
if MaxEntries == 9 and Low <= 십차 Then
buy("b10");
if MaxEntries == 10 and Low <= 십일차 Then
buy("b11");
if MaxEntries == 11 and Low <= 십이차 Then
buy("b12");
if MaxEntries == 12 and Low <= 십삼차 Then
buy("b13");
if MaxEntries == 13 and Low <= 십사차 Then
buy("b14");
if MaxEntries == 14 and Low <= 십오차 Then
buy("b15");
if MaxEntries == 15 and Low <= 십육차 Then
buy("b16");
if MaxEntries == 16 and Low <= 십칠차 Then
buy("b17");
if MaxEntries == 17 and Low <= 십팔차 Then
buy("b18");
if MaxEntries == 18 and Low <= 십구차 Then
buy("b19");
if MaxEntries == 19 and Low <= 이십차 Then
buy("b20");
if High >= lowest(L,900)*프로 Then
ExitLong("BP",atlimit,lowest(L,900)*프로);
count = count + 1;
if Low < 손절 Then
exitlong("BL");
count = count + 1;
}
2024-10-02
858
글번호 183919
시스템
답변완료
추세선 하락 3파
Input : 전환(0.2);
Var:j(0),jj(0),HH(0),LL(0),hiBar(0),loBar(0),최종꼭지점(""),처리구분("");
Array:고[10,4](0),저[10,4](0);
var : TL(0), TL1(0),T(0),Tx(0);
Plot1(c);
HH = H;
LL = L;
If Index == 0 Then
{
고[1,1] = HH;
고[1,2] = 0;
고[1,3] = sDate;
고[1,4] = sTime;
저[1,1] = LL;
저[1,2] = 0;
저[1,3] = sDate;
저[1,4] = sTime;
}
If Index > 0 Then
{
hiBar = hiBar + 1;
loBar = loBar + 1;
}
If HH[hiBar] < HH Then hiBar = 0;
If LL[loBar] > LL Then loBar = 0;
Condition1 = 저[1,1]+전환 <= HH and hiBar == 0;
Condition2 = 고[1,1]-전환 >= LL and loBar == 0;
처리구분 = "";
If Condition1 and Condition2 Then
{
If 최종꼭지점 == "저점" Then
{
If 저[1,1] > LL Then 처리구분 = "저점처리";
Else 처리구분 = "고점처리";
}
Else If 최종꼭지점 == "고점" Then
{
If 고[1,1] < HH Then 처리구분 = "고점처리";
Else 처리구분 = "저점처리";
}
}
Else If Condition1 Then 처리구분 = "고점처리";
Else If Condition2 Then 처리구분 = "저점처리";
If 처리구분 == "고점처리" Then
{
t = 1;
If 최종꼭지점 == "저점" Then
{
For j = 10 DownTo 2
{
For jj = 1 To 4
{
고[j,jj] = 고[j-1,jj];
}
}
고[1,1] = HH[hiBar];
고[1,2] = Index - hiBar;
고[1,3] = sDate[hiBar];
고[1,4] = sTime[hiBar];
hiBar = -1;
loBar = -1;
TL = TL_New(저[1,3],저[1,4],저[1,1],고[1,3],고[1,4],고[1,1]);
TL_SetSize(TL,1);
TL_SetColor(TL,Red);
Text_SetSize(tx,25);
Text_SetColor(tx,Blue);
Text_SetStyle(tx,1,0);
Text_SetBold(tx,1);
if abs(고[1,1][1]-저[1,1][1]) < 0.5 Then
Text_Delete(tx);
TX = Text_New(고[1,3],고[1,4],고[1,1],NumToStr(고[1,1]-저[1,1],2));
Text_SetSize(tx,25);
Text_SetColor(tx,Red);
Text_SetStyle(tx,1,1);
Text_SetBold(tx,1);
Condition8 = False;
if Condition8 == False and 저[1,1]<= 고[1,1]-0.5 Then
{
Condition8 = true;
}
}
If 고[1,1] < HH[hiBar] Then
{
고[1,1] = HH[hiBar];
고[1,2] = Index - hiBar;
고[1,3] = sDate[hiBar];
고[1,4] = sTime[hiBar];
hiBar = -1;
loBar = -1;
if Condition8 == False and 저[1,1] <= 고[1,1]-0.5 Then
{
Condition8 = true;
TL1= TL_New(sDate,sTime,h-0.5,sDate,sTime,-999);
TL_SetColor(TL1,Red);
TL_SetSize(TL1,2);
}
TL_SetEnd(TL,고[1,3],고[1,4],고[1,1]);
Text_SetString(TX,NumToStr(고[1,1]-저[1,1],2));
Text_SetLocation(TX,고[1,3],고[1,4],고[1,1]);
}
최종꼭지점 = "고점";
}
If 처리구분 == "저점처리" Then
{
t = -1;
If 최종꼭지점 == "고점" Then
{
For j = 10 DownTo 2
{
For jj = 1 To 4
{
저[j,jj] = 저[j-1,jj];
}
}
저[1,1] = LL[loBar];
저[1,2] = Index - loBar;
저[1,3] = sDate[loBar];
저[1,4] = sTime[loBar];
hiBar = -1;
loBar = -1;
TL = TL_New(고[1,3],고[1,4],고[1,1],저[1,3],저[1,4],저[1,1]);
TL_SetSize(TL,1);
TL_SetColor(TL,Green);
Text_SetSize(tx,25);
Text_SetColor(tx,Red);
Text_SetStyle(tx,1,1);
Text_SetBold(tx,1);
if abs(고[1,1][1]-저[1,1][1]) < 0.5 Then
Text_Delete(tx);
TX = Text_New(저[1,3],저[1,4],저[1,1],NumToStr(고[1,1]-저[1,1],2));
Text_SetSize(tx,25);
Text_SetColor(tx,Blue);
Text_SetStyle(tx,1,0);
Text_SetBold(tx,1);
Condition4 = False;
if Condition4 == False and 저[1,1]<= 고[1,1]-0.5 Then
{
Condition4 = true;
}
}
If 저[1,1] > LL[loBar] Then
{
저[1,1] = LL[loBar];
저[1,2] = Index - loBar;
저[1,3] = sDate[loBar];
저[1,4] = sTime[loBar];
hiBar = -1;
loBar = -1;
if Condition4 == False and 저[1,1] <= 고[1,1]-0.5 Then
{
Condition4 = true;
TL1= TL_New(sDate,sTime,L+0.5,sDate,sTime,999);
TL_SetColor(TL1,Blue);
TL_SetSize(TL1,2);
}
TL_SetEnd(TL,저[1,3],저[1,4],저[1,1]);
Text_SetString(TX,NumToStr(고[1,1]-저[1,1],2));
Text_SetLocation(TX,저[1,3],저[1,4],저[1,1]);
}
최종꼭지점 = "저점";
}
추세선의 크기가 0.5 이상이면 세로선 표시되는 수식입니다.
하락추세선의 크기가 0.5 이상일 때만 카운트해서 세번째 하락 0.5파에 네모 표시.
0.5 이하는 무시. 저점은 무관. (고점 낮은 세번째 세로선)
고점이 같거나 낮을 때만 카운트. 직전 하락 0.5파보다 고점이 높으면 다시 새로 카운트.
감사합니다.
2024-10-02
671
글번호 183901
지표