| Q&A 게시판 | HOME > Q&A 게시판 |
작성자 :
폭수
작성일 : 2021-06-19 16:13:57
조회수 : 983
Hit the bulls eye 매수가 설정
코멘트란에 있는 수식을 복사해왔습니다. Buy 신호가 왔을때 진입금액을 수량 말고 그냥 금액으로 고쳐 주실수 있나요? 간단한 수식을 짰을때 보면 금액도 마음대로 설정하고 손절, 익절 설정 가능 하던데,, 그렇게 좀 수정 부탁드려요~!
고맙습니다~.
[시스템식] Hit The Bull's Eye
Inputs: RangeLength(5), XAvgLength(50), BarstoEnter(5), Factor(3);
Variables: BuyEntry(0), BuySetup(False), BuyCounter(0), LongExitTarget(0);
Variables: SellEntry(0), SellSetup(False), SellCounter(0), ShortExitTarget(0);
Condition1 = High == Highest(High, RangeLength);
Condition2 = Close > High[2];
Condition3 = ema(Close, XAvgLength) > ema(Close, XAvgLength)[1];
Condition4 = Low == Lowest(Low, RangeLength);
Condition5 = Close < Low[2];
Condition6 = ema(Close, XAvgLength) < ema(Close, XAvgLength)[1];
If MarketPosition <> 1 AND Condition1 AND Condition2 AND Condition3 Then Begin
BuyEntry = MedianPrice[2];
BuyCounter = 0;
BuySetup = True;
LongExitTarget = High + Factor * (High - BuyEntry);
End;
If BuyCounter > BarstoEnter Then
BuySetup = False;
Else
BuyCounter = BuyCounter + 1;
If MarketPosition == 1 Then Begin
BuySetup = False;
ExitLong("EL_Target",atlimit,LongExitTarget);
End;
If BuySetup Then
Buy("Buy",atlimit,BuyEntry);
If MarketPosition <> -1 AND Condition4 AND Condition5 AND Condition6 Then Begin
SellEntry = MedianPrice[2];
SellCounter = 0;
SellSetup = True;
ShortExitTarget = Low - Factor * (SellEntry - Low);
End;
If SellCounter > BarstoEnter Then
SellSetup = False;
Else
SellCounter = SellCounter + 1;
/*If MarketPosition == -1 Then Begin
SellSetup = False;
ExitShort("ES_Target",atlimit,ShortExitTarget);
End;*/
If SellSetup Then
Sell("EL_sell",atlimit,SellEntry);
# ATR Protective Stop
Inputs: ProtectiveATRs(3);
var : AtrV(0);
AtrV = ATR(30);
If MarketPosition <> 0 Then {
ExitLong("EL_Protective Stop", atstop, EntryPrice - AtrV*ProtectiveATRs);
ExitShort("ES_Protective Stop", atstop, EntryPrice + AtrV*ProtectiveATRs);
}
[지표식] HitTheBullsEye_Line
Inputs: RangeLength(5), XAvgLength(50), BarstoEnter(5), Factor(3);
Variables: BuyEntry(0), BuySetup(False), BuyCounter(0), LongExitTarget(0);
Variables: SellEntry(0), SellSetup(False), SellCounter(0), ShortExitTarget(0);
Condition1 = High == Highest(High, RangeLength);
Condition2 = Close > High[2];
Condition3 = ema(Close, XAvgLength) > ema(Close, XAvgLength)[1];
Condition4 = Low == Lowest(Low, RangeLength);
Condition5 = Close < Low[2];
Condition6 = ema(Close, XAvgLength) < ema(Close, XAvgLength)[1];
If i_MarketPosition <> 1 AND Condition1 AND Condition2 AND Condition3 Then Begin
BuyEntry = MedianPrice()[2];
BuyCounter = 0;
BuySetup = True;
LongExitTarget = High + Factor * (High - BuyEntry);
End;
If BuyCounter > BarstoEnter Then
BuySetup = False;
Else
BuyCounter = BuyCounter + 1;
If i_MarketPosition == 1 Then Begin
BuySetup = False;
//ExitLong("EL1", atLimit, LongExitTarget );
End;
/*If BuySetup Then
Buy("B1", atlimit, BuyEntry );*/
If Condition4 AND Condition5 AND Condition6 Then Begin
SellEntry = MedianPrice()[2];
SellCounter = 0;
SellSetup = True;
ShortExitTarget = Low - Factor * (SellEntry - Low);
End;
If SellCounter > BarstoEnter Then
SellSetup = False;
Else
SellCounter = SellCounter + 1;
if buysetup[1] == true then
plot1(BuyEntry[1], "매수라인");
if i_marketposition[1] == 1 then
plot2(LongExitTarget[1], "매수목표가");
if sellsetup[1] == true and i_marketposition[1] == 1 then
plot3(sellentry[1], "매도라인");
# ATR Protective Stop
Inputs: ProtectiveATRs(3);
var : AtrV(0);
AtrV = ATR(30);
If i_MarketPosition ==1 Then
plot4(i_AvgEntryPrice - AtrV*ProtectiveATRs, "ATR청산");
고맙습니다~.
[시스템식] Hit The Bull's Eye
Inputs: RangeLength(5), XAvgLength(50), BarstoEnter(5), Factor(3);
Variables: BuyEntry(0), BuySetup(False), BuyCounter(0), LongExitTarget(0);
Variables: SellEntry(0), SellSetup(False), SellCounter(0), ShortExitTarget(0);
Condition1 = High == Highest(High, RangeLength);
Condition2 = Close > High[2];
Condition3 = ema(Close, XAvgLength) > ema(Close, XAvgLength)[1];
Condition4 = Low == Lowest(Low, RangeLength);
Condition5 = Close < Low[2];
Condition6 = ema(Close, XAvgLength) < ema(Close, XAvgLength)[1];
If MarketPosition <> 1 AND Condition1 AND Condition2 AND Condition3 Then Begin
BuyEntry = MedianPrice[2];
BuyCounter = 0;
BuySetup = True;
LongExitTarget = High + Factor * (High - BuyEntry);
End;
If BuyCounter > BarstoEnter Then
BuySetup = False;
Else
BuyCounter = BuyCounter + 1;
If MarketPosition == 1 Then Begin
BuySetup = False;
ExitLong("EL_Target",atlimit,LongExitTarget);
End;
If BuySetup Then
Buy("Buy",atlimit,BuyEntry);
If MarketPosition <> -1 AND Condition4 AND Condition5 AND Condition6 Then Begin
SellEntry = MedianPrice[2];
SellCounter = 0;
SellSetup = True;
ShortExitTarget = Low - Factor * (SellEntry - Low);
End;
If SellCounter > BarstoEnter Then
SellSetup = False;
Else
SellCounter = SellCounter + 1;
/*If MarketPosition == -1 Then Begin
SellSetup = False;
ExitShort("ES_Target",atlimit,ShortExitTarget);
End;*/
If SellSetup Then
Sell("EL_sell",atlimit,SellEntry);
# ATR Protective Stop
Inputs: ProtectiveATRs(3);
var : AtrV(0);
AtrV = ATR(30);
If MarketPosition <> 0 Then {
ExitLong("EL_Protective Stop", atstop, EntryPrice - AtrV*ProtectiveATRs);
ExitShort("ES_Protective Stop", atstop, EntryPrice + AtrV*ProtectiveATRs);
}
[지표식] HitTheBullsEye_Line
Inputs: RangeLength(5), XAvgLength(50), BarstoEnter(5), Factor(3);
Variables: BuyEntry(0), BuySetup(False), BuyCounter(0), LongExitTarget(0);
Variables: SellEntry(0), SellSetup(False), SellCounter(0), ShortExitTarget(0);
Condition1 = High == Highest(High, RangeLength);
Condition2 = Close > High[2];
Condition3 = ema(Close, XAvgLength) > ema(Close, XAvgLength)[1];
Condition4 = Low == Lowest(Low, RangeLength);
Condition5 = Close < Low[2];
Condition6 = ema(Close, XAvgLength) < ema(Close, XAvgLength)[1];
If i_MarketPosition <> 1 AND Condition1 AND Condition2 AND Condition3 Then Begin
BuyEntry = MedianPrice()[2];
BuyCounter = 0;
BuySetup = True;
LongExitTarget = High + Factor * (High - BuyEntry);
End;
If BuyCounter > BarstoEnter Then
BuySetup = False;
Else
BuyCounter = BuyCounter + 1;
If i_MarketPosition == 1 Then Begin
BuySetup = False;
//ExitLong("EL1", atLimit, LongExitTarget );
End;
/*If BuySetup Then
Buy("B1", atlimit, BuyEntry );*/
If Condition4 AND Condition5 AND Condition6 Then Begin
SellEntry = MedianPrice()[2];
SellCounter = 0;
SellSetup = True;
ShortExitTarget = Low - Factor * (SellEntry - Low);
End;
If SellCounter > BarstoEnter Then
SellSetup = False;
Else
SellCounter = SellCounter + 1;
if buysetup[1] == true then
plot1(BuyEntry[1], "매수라인");
if i_marketposition[1] == 1 then
plot2(LongExitTarget[1], "매수목표가");
if sellsetup[1] == true and i_marketposition[1] == 1 then
plot3(sellentry[1], "매도라인");
# ATR Protective Stop
Inputs: ProtectiveATRs(3);
var : AtrV(0);
AtrV = ATR(30);
If i_MarketPosition ==1 Then
plot4(i_AvgEntryPrice - AtrV*ProtectiveATRs, "ATR청산");
