답변완료
수정부탁드립니다
삼각형내부 색상 입히기 수정부탁드립니다.
Input:lengthk(12);
Var:처리순서(0),lastHiVal(0),lastLoVal(0),sBar(0),eBar(0),TtL1(0),TtL2(0),TtL3(0),
Text1(0),처리구분(""),T(0);
Array:고점[10,2](0),저점[10,2](0); //가격,위치
처리구분 = "";
If Highest(H,lengthk) == H and lastHiVal <> H and
Lowest(L,lengthk) == L and lastLoVal <> L Then
{
If 저점[1,1] > L Then 처리구분 = "저점처리";
If 고점[1,1] < H Then 처리구분 = "고점처리";
}
Else If Highest(H,lengthk) == H and lastHiVal <> H Then
처리구분 = "고점처리";
Else If Lowest(L,lengthk) == L and lastLoVal <> L Then
처리구분 = "저점처리";
If 처리구분 == "고점처리" Then
{
lastHiVal = H;
If 고점[1,2] < 저점[1,2] Then
{
For 처리순서 = 10 DownTo 2
{
고점[처리순서,1] = 고점[처리순서-1,1];
고점[처리순서,2] = 고점[처리순서-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(TtL1) == sDate[sBar] and
TL_GetBeginTime(TtL1) == sTime[sBar] Then
{
TL_Delete(TtL1);
TL_Delete(TtL2);
TL_Delete(TtL3);
Text_Delete(Text1);
}
TtL1 = TL_New(sDate[sBar],sTime[sBar],저점[1,1],sDate[eBar],sTime[eBar],고점[1,1]);
TtL2 = TL_New(sDate[sBar],sTime[sBar],저점[1,1],sDate[eBar],sTime[eBar],저점[1,1]);
TtL3 = TL_New(sDate[eBar],sTime[eBar],저점[1,1],sDate[eBar],sTime[eBar],고점[1,1]);
Text1 = Text_New(sDate[eBar],sTime[eBar],고점[1,1], NumToStr(고점[1,1],2));
Text_SetStyle(Text1, 2, 1);
TL_SetSize(TtL1,2);
TL_SetColor(TtL1,red);
TL_SetSize(TtL2,2);
TL_SetColor(TtL2,red);
TL_SetSize(TtL3,2);
TL_SetColor(TtL3,BLACK);
}
}
If 처리구분 == "저점처리" Then
{
lastLoVal = L;
If 저점[1,2] < 고점[1,2] then
{
For 처리순서 = 10 DownTo 2
{
저점[처리순서,1] = 저점[처리순서-1,1];
저점[처리순서,2] = 저점[처리순서-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(TtL1) == sDate[sBar] and
TL_GetBeginTime(TtL1) == sTime[sBar] Then
{
TL_Delete(TtL1);
TL_Delete(TtL2);
TL_Delete(TtL3);
Text_Delete(Text1);
}
TtL1 = TL_New(sDate[sBar],sTime[sBar],고점[1,1],sDate[eBar],sTime[eBar],저점[1,1]);
TtL2 = TL_New(sDate[sBar],sTime[sBar],고점[1,1],sDate[eBar],sTime[eBar],고점[1,1]);
TtL3 = TL_New(sDate[eBar],sTime[eBar],고점[1,1],sDate[eBar],sTime[eBar],저점[1,1]);
Text1 = Text_New(sDate[eBar],sTime[eBar],저점[1,1],NumToStr(저점[1,1],2));
Text_SetStyle(Text1, 2, 0);
TL_SetSize(TtL1,2);
TL_SetColor(TtL1,blue);
TL_SetSize(TtL2,2);
TL_SetColor(TtL2,blue);
TL_SetSize(TtL3,2);
TL_SetColor(TtL3,BLACK);
}
}
2022-11-16
938
글번호 163844
지표
답변완료
문의 드립니다
input:length(5),a틱(10),b틱(10),c틱(5);
Var:j(0),lastHiVal(0),lastLoVal(0),sBar(0),eBar(0),TL1(0),Text1(0),process(0),T(0);
Array:HH[10,2](0),LL[10,2](0);
process = 0;
If Highest(H,length) == H and lastHiVal <> H and Lowest(L,length) == L and lastLoVal <> L Then
{
If LL[1,1] > L Then process = -1;
If HH[1,1] < H Then process = 1;
}
Else If Highest(H,length) == H and lastHiVal <> H Then process = 1;
Else If Lowest(L,length) == L and lastLoVal <> L Then process = -1;
If process == 1 Then
{
T = 1;
lastHiVal = H;
If HH[1,2] < LL[1,2] Then
{
For j = 10 DownTo 2
{
HH[j,1] = HH[j-1,1];
HH[j,2] = HH[j-1,2];
}
}
If HH[1,2] < LL[1,2] or HH[1,1] < H Then
{
HH[1,1] = H;
HH[1,2] = Index;
sBar = Index - LL[1,2];
eBar = 0;
If TL_GetBeginDate(TL1) == sDate[sBar] and TL_GetBeginTime(TL1) == sTime[sBar] Then
{
TL_Delete(TL1);
Text_Delete(Text1);
}
if LL[1,1] > 0 Then
{
TL1 = TL_New(sDate[sBar],sTime[sBar],LL[1,1],sDate[eBar],sTime[eBar],HH[1,1]);
Text1 = Text_New(sDate[eBar],sTime[eBar],HH[1,1],"+"+NumToStr(abs(HH[1,1]-LL[1,1])/PriceScale,0));
Text_SetStyle(Text1, 2, 1);
}
Else
{
Text_Delete(text1);
Text1 = Text_New(sDate[eBar],sTime[eBar],HH[1,1],"+"+NumToStr(abs(HH[1,1]-LL[1,1])/PriceScale,2));
Text_SetStyle(Text1, 2, 1);
}
Text_SetStyle(Text1, 2, 1);
}
if MarketPosition <= 0 and
HH[2,1] >= LL[2,1]+PriceScale*a틱 and
LL[1,1] <= HH[2,1]-PriceScale*b틱 Then
Buy("b",AtStop,HH[2,1]+PriceScale*c틱);
}
If process == -1 Then
{
T = -1;
lastLoVal = L;
If LL[1,2] < HH[1,2] Then
{
For j = 10 DownTo 2
{
LL[j,1] = LL[j-1,1];
LL[j,2] = LL[j-1,2];
}
}
If LL[1,2] < HH[1,2] or LL[1,1] > L Then
{
LL[1,1] = L;
LL[1,2] = Index;
sBar = Index - HH[1,2];
eBar = 0;
If TL_GetBeginDate(TL1) == sDate[sBar] and TL_GetBeginTime(TL1) == sTime[sBar] Then
{
TL_Delete(TL1);
Text_Delete(Text1);
}
if HH[1,1] > 0 Then
{
TL1 = TL_New(sDate[sBar],sTime[sBar],HH[1,1],sDate[eBar],sTime[eBar],LL[1,1]);
Text1 = Text_New(sDate[eBar],sTime[eBar],LL[1,1],"-"+NumToStr(abs(HH[1,1]-LL[1,1])/PriceScale,0));
Text_SetStyle(Text1, 2, 0);
}
Else
{
Text_Delete(text1);
Text1 = Text_New(sDate[eBar],sTime[eBar],LL[1,1],"-"+NumToStr(abs(HH[1,1]-LL[1,1])/PriceScale,0));
Text_SetStyle(Text1, 2, 0);
}
}
if MarketPosition >= 0 and
LL[2,1] <= HH[2,1]-PriceScale*a틱 and
HH[1,1] >= LL[2,1]+PriceScale*b틱 Then
Sell("s",AtStop,LL[2,1]-PriceScale*c틱);
}
추세선은 매매시간 넣으니 오류가 자꾸 나네요
해외선물 매매시간 좀 넣어주세요 ~
15:00~ 익일 06:00 , 익일 06 :00는 오버없는 자동청산입니다
----------------
input : 익절틱수(0),손절틱수(0);
if NextBarSdate != sDate Then
{
if NextBarOpen > C Then
{
Buy("b",AtStop,NextBarOpen+PriceScale*10);
Sell("s",AtStop,NextBarOpen-PriceScale*10);
}
if NextBarOpen < C Then
{
ExitLong("bx",AtStop,NextBarOpen-PriceScale*10);
ExitShort("sx",AtStop,NextBarOpen+PriceScale*10);
}
}
if MarketPosition > 1 Then
Sell("ss",AtStop,EntryPrice-10);
if MarketPosition < -1 Then
Buy("ss1",AtStop,EntryPrice+10);
SetStopProfittarget(PriceScale*익절틱수,PointStop);
SetStopLoss(PriceScale*손절틱수,PointStop);
if NextBarSdate != sDate Then
{
if NextBarOpen > C Then
{
Buy("b2",AtStop,NextBarOpen+PriceScale*10);
Sell("s2",AtStop,NextBarOpen-PriceScale*10);
}
if NextBarOpen < C Then
{
ExitLong("bx2",AtStop,NextBarOpen-PriceScale*10);
ExitShort ("sx2",AtStop,NextBarOpen+PriceScale*10);
}
}
if MarketPosition > 1 Then
Sell("sss",AtStop,EntryPrice-10);
if MarketPosition < -1 Then
Buy("sss1",AtStop,EntryPrice+10);
SetStopProfittarget(PriceScale*익절틱수,PointStop);
SetStopLoss(PriceScale*손절틱수,PointStop);
if NextBarSdate != sDate Then
{
if NextBarOpen < C Then
{
Buy("b8",AtStop,NextBarOpen+PriceScale*10);
Sell("s8",AtStop,NextBarOpen-PriceScale*10);
}
if NextBarOpen > C Then
{
ExitLong("bx8",AtStop,NextBarOpen-PriceScale*10);
ExitShort("sx8",AtStop,NextBarOpen+PriceScale*10);
}
}
if MarketPosition > 1 Then
Sell("bb",AtStop,EntryPrice-10);
if MarketPosition < -1 Then
Buy("bb1",AtStop,EntryPrice+10);
SetStopProfittarget(PriceScale*익절틱수,PointStop);
SetStopLoss(PriceScale*손절틱수,PointStop);
SetStopProfittarget(PriceScale*익절틱수,PointStop);
SetStopLoss(PriceScale*손절틱수,PointStop);
if NextBarSdate != sDate Then
{
if NextBarOpen < C Then
{
Buy("b9",AtStop,NextBarOpen+PriceScale*10);
Sell("s9",AtStop,NextBarOpen-PriceScale*10);
}
if NextBarOpen > C Then
{
ExitLong("bx9",AtStop,NextBarOpen-PriceScale*10);
ExitShort("sx9",AtStop,NextBarOpen+PriceScale*10);
}
}
if MarketPosition > 1 Then
Sell("bbb",AtStop,EntryPrice-10);
if MarketPosition < -1 Then
Buy("bbb1",AtStop,EntryPrice+10);
SetStopProfittarget(PriceScale*익절틱수,PointStop);
SetStopLoss(PriceScale*손절틱수,PointStop);
SetStopProfittarget(PriceScale*익절틱수,PointStop);
SetStopLoss(PriceScale*손절틱수,PointStop);
------------------
해외선물 매매시간 08 :00 ~ 익일 06 :00 자동청산
2회까지 진입신호후 아침 06시 자동청산의 수식어 추가를 부탁드립니다.
2022-11-16
1300
글번호 163841
시스템