커뮤니티
수식
2011-06-16 14:14:46
609
글번호 39855
수정부탁드립니다
청산후 바로재진입이되는데 수정부탁드립니다
//************************************************************************************************************************
If (stime > 91000 and stime < 113000) THEN {
Condition1 = IsExitName("StopProfittarget",1) and ExitDate(1) == sdate;
if BarsSinceExit(1) > 1 then { ##청산신호 후에 1봉이 경과 할때까지 재진입을 금지하라
if stime>=090100 and Stime< 150300 and marketposition==0 then
if C > H[1] and ((Condition1 == true and BarsSinceExit(1) >= 1) or Condition1 == false) Then
buy("매수");
if MarketPosition == 1 Then
sell("반대매도",AtStop,L[BarsSinceEntry]-0.5-PriceScale); ##진입봉의 고가는 H[BarsSinceEntry] if MarketPosition == -1 Then buy("SB",AtStop,H[BarsSinceEntry]+PriceScale);
##매도진입후 매도진입봉의 고가+1틱이상의 시세가 발생하면 매도로 전환
##진입봉의 저가는 L[BarsSinceEntry] if MarketPosition == 1 Then sell("BS",AtStop,L[BarsSinceEntry]-PriceScale);
##매수진입후 매수진입봉의 저가-1틱 이하의 시세가 발생하면 매수로 전환
if C < L[1] and ((Condition1 == true and BarsSinceExit(1) >= 1) or Condition1 == false) Then
sell("매도");
if MarketPosition == -1 Then
buy("반대매수",AtStop,H[BarsSinceEntry]+0.7+PriceScale);
}
}
If (stime > 110000 and stime < 140000) THEN {
Condition1 = IsExitName("StopProfittarget",1) and ExitDate(1) == sdate;
Inputs: PercentRLen(10), OverSold(10), OverBought(90), Trigger(62);
Variables: PcntR(0), AvgValue(0), Setup1(False), Setup2(False);
PcntR = PercentR(PercentRLen);
AvgValue = MA(Close, PercentRLen);
If PcntR < OverSold Then
Setup1 = True;
If PcntR > OverBought Then
Setup1 = False;
If PcntR > OverBought Then
Setup2 = True;
If PcntR < OverSold Then
Setup2 = False;
If Setup1 AND AvgValue > AvgValue[1] AND Crossup(PcntR,Trigger) and ((Condition1 == true and BarsSinceExit(1) >= 1) or Condition1 == false) Then Begin{
Setup1 = False;
Buy ("11시이후매수");
}
End;
If Setup2 AND AvgValue < AvgValue[1] AND CrossDown(PcntR, Trigger) and ((Condition1 == true and BarsSinceExit(1) >= 1) or Condition1 == false) Then Begin{
Setup2 = False;
}
End;
If (stime >= 100000 and stime < 145000) THEN {
Condition1 = IsExitName("StopProfittarget",1) and ExitDate(1) == sdate;
Inputs: Length1(5),Length2(3),Length3(3),OverSold11(30),OverBought11(70);
Variables: KLine(0), DLine(0);
Var : value(0);
KLine = StochasticsK(Length1,Length2);
DLine = StochasticsD(Length1,Length2,Length3);
If Crossup(KLine[5], DLine[5]) AND KLine[5] < OverSold11 AND DLine[5] < OverSold11 and ((Condition1 == true and BarsSinceExit(1) >= 1) or Condition1 == false) Then ##스토매수 신호을 3개봉뒤에 신호나옴
buy("스토매수",AtStop,value);
If (stime >= 100000 and stime < 135000) THEN {
If CrossDown(KLine, DLine) AND KLine > OverBought11 AND DLine < OverBought11 and ((Condition1 == true and BarsSinceExit(1) >= 1) or Condition1 == false) Then
sell ("스토매도",AtStop,value);
}
}
}
If (stime >= 90000 and stime < 150000) THEN {
Condition1 = IsExitName("StopProfittarget",1) and ExitDate(1) == sdate;
Input : Period(12), Period1(5), Period2(5);
value1 = StochasticsK(Period,Period1);
value2 = StochasticsD(Period,Period1,Period2);
If CrossDown(value1, value2) Then {
var1 = C;#데드크로스시 발생시 초기값
var2 = var1[1]; # 직전 데드크로스 구간의 종가 중 최저가
}
#가장 최근 데드크로스 구간의 종가중 최저가 계산
if value1[1] < value2[1] Then{
if C < var1 Then
var1 = L;
}
if CrossUp(value1,value2) Then{
var3 = value1; #골든크로스시 value1값
var4 = var3[1];#직전골든크로스시 value1값
if var3 > var4 and var1 < var2 and ((Condition1 == true and BarsSinceExit(1) >= 1) or Condition1 == false) Then
buy("골든크로스시",atmarket);
}
}
If (stime >= 130000 and stime < 150000) THEN {
Condition1 = IsExitName("StopProfittarget",1) and ExitDate(1) == sdate;
if min(c,O) > ma(c,3) and min(C,H) > ma(c,20) and ((Condition1 == true and BarsSinceExit(1) >= 1) or Condition1 == false) Then
buy("이평매수");
}
If (stime >= 110000 and stime < 150000) THEN {
if max(c,O) < ma(c,5) and max(C,H) > ma(c,20) and ((Condition1 == true and BarsSinceExit(1) >= 1) or Condition1 == false) Then
sell("이평매도");
}
If (stime >= 100000 and stime < 150000) THEN {
var : slowK1(0), slowD1(0), slowK2(0), slowD2(0);
Condition1 = IsExitName("StopProfittarget",1) and ExitDate(1) == sdate;
slowK1 = stochasticsK(12,5);
slowD1 = stochasticsD(20,12,12);
slowK2 = stochasticsK(12,5);
slowD2 = stochasticsD(12,5,5);
if BarsSinceExit(1) > 3 then { ##청산신호 후에 1봉이 경과 할때까지 재진입을 금지하라
if stime>=100000 and Stime< 150300 and marketposition==0 then
if slowK1 > slowD1 and crossup(slowK2,slowD2) and ((Condition1 == true and BarsSinceExit(1) >= 1) or Condition1 == false) Then
buy("스토12");
//if CrossDown(slowK2,slowD2) and ((Condition1 == true and BarsSinceExit(1) >= 1) or Condition1 == false) Then
//ExitLong("청산매도");
}
}
SetStopProfittarget(1.0,PercentStop);
SetStopTrailing(0.05,1.0,PointStop);
SetStopLoss(1.0,PercentStop);
답변 1
예스스탁 예스스탁 답변
2011-06-16 14:29:58
안녕하세요
예스스탁입니다.
If (stime > 91000 and stime < 113000) THEN {
Condition1 = IsExitName("StopProfittarget",1) and ExitDate(1) == sdate;
if BarsSinceExit(1) > 1 then { ##청산신호 후에 1봉이 경과 할때까지 재진입을 금지하라
if stime>=090100 and Stime< 150300 and marketposition==0 then
if C > H[1] and ((Condition1 == true and BarsSinceExit(1) >= 1) or Condition1 == false) and MarketPosition == 0 Then
buy("매수");
if MarketPosition == 1 Then
sell("반대매도",AtStop,L[BarsSinceEntry]-0.5-PriceScale); ##진입봉의 고가는 H[BarsSinceEntry] if MarketPosition == -1 Then buy("SB",AtStop,H[BarsSinceEntry]+PriceScale);
##매도진입후 매도진입봉의 고가+1틱이상의 시세가 발생하면 매도로 전환
##진입봉의 저가는 L[BarsSinceEntry] if MarketPosition == 1 Then sell("BS",AtStop,L[BarsSinceEntry]-PriceScale);
##매수진입후 매수진입봉의 저가-1틱 이하의 시세가 발생하면 매수로 전환
if C < L[1] and ((Condition1 == true and BarsSinceExit(1) >= 1) or Condition1 == false) Then
sell("매도");
if MarketPosition == -1 Then
buy("반대매수",AtStop,H[BarsSinceEntry]+0.7+PriceScale);
}
}
If (stime > 110000 and stime < 140000) THEN {
Condition1 = IsExitName("StopProfittarget",1) and ExitDate(1) == sdate;
Inputs: PercentRLen(10), OverSold(10), OverBought(90), Trigger(62);
Variables: PcntR(0), AvgValue(0), Setup1(False), Setup2(False);
PcntR = PercentR(PercentRLen);
AvgValue = MA(Close, PercentRLen);
If PcntR < OverSold Then
Setup1 = True;
If PcntR > OverBought Then
Setup1 = False;
If PcntR > OverBought Then
Setup2 = True;
If PcntR < OverSold Then
Setup2 = False;
If Setup1 AND AvgValue > AvgValue[1] AND Crossup(PcntR,Trigger) and ((Condition1 == true and BarsSinceExit(1) >= 1) or Condition1 == false) Then Begin{
Setup1 = False;
Buy ("11시이후매수");
}
End;
If Setup2 AND AvgValue < AvgValue[1] AND CrossDown(PcntR, Trigger) and ((Condition1 == true and BarsSinceExit(1) >= 1) or Condition1 == false) Then Begin{
Setup2 = False;
}
End;
If (stime >= 100000 and stime < 145000) THEN {
Condition1 = IsExitName("StopProfittarget",1) and ExitDate(1) == sdate;
Inputs: Length1(5),Length2(3),Length3(3),OverSold11(30),OverBought11(70);
Variables: KLine(0), DLine(0);
Var : value(0);
KLine = StochasticsK(Length1,Length2);
DLine = StochasticsD(Length1,Length2,Length3);
If MarketPosition == 0 and Crossup(KLine[5], DLine[5]) AND KLine[5] < OverSold11 AND DLine[5] < OverSold11 and ((Condition1 == true and BarsSinceExit(1) >= 1) or Condition1 == false) Then ##스토매수 신호을 3개봉뒤에 신호나옴
buy("스토매수",AtStop,value);
If (stime >= 100000 and stime < 135000) THEN {
If MarketPosition == 0 and CrossDown(KLine, DLine) AND KLine > OverBought11 AND DLine < OverBought11 and ((Condition1 == true and BarsSinceExit(1) >= 1) or Condition1 == false) Then
sell ("스토매도",AtStop,value);
}
}
}
If (stime >= 90000 and stime < 150000) THEN {
Condition1 = IsExitName("StopProfittarget",1) and ExitDate(1) == sdate;
Input : Period(12), Period1(5), Period2(5);
value1 = StochasticsK(Period,Period1);
value2 = StochasticsD(Period,Period1,Period2);
If CrossDown(value1, value2) Then {
var1 = C;#데드크로스시 발생시 초기값
var2 = var1[1]; # 직전 데드크로스 구간의 종가 중 최저가
}
#가장 최근 데드크로스 구간의 종가중 최저가 계산
if value1[1] < value2[1] Then{
if C < var1 Then
var1 = L;
}
if CrossUp(value1,value2) Then{
var3 = value1; #골든크로스시 value1값
var4 = var3[1];#직전골든크로스시 value1값
if MarketPosition == 0 and var3 > var4 and var1 < var2 and ((Condition1 == true and BarsSinceExit(1) >= 1) or Condition1 == false) Then
buy("골든크로스시",atmarket);
}
}
If (stime >= 130000 and stime < 150000) THEN {
Condition1 = IsExitName("StopProfittarget",1) and ExitDate(1) == sdate;
if MarketPosition == 0 and min(c,O) > ma(c,3) and min(C,H) > ma(c,20) and ((Condition1 == true and BarsSinceExit(1) >= 1) or Condition1 == false) Then
buy("이평매수");
}
If (stime >= 110000 and stime < 150000) THEN {
if MarketPosition == 0 and max(c,O) < ma(c,5) and max(C,H) > ma(c,20) and ((Condition1 == true and BarsSinceExit(1) >= 1) or Condition1 == false) Then
sell("이평매도");
}
If (stime >= 100000 and stime < 150000) THEN {
var : slowK1(0), slowD1(0), slowK2(0), slowD2(0);
Condition1 = IsExitName("StopProfittarget",1) and ExitDate(1) == sdate;
slowK1 = stochasticsK(12,5);
slowD1 = stochasticsD(20,12,12);
slowK2 = stochasticsK(12,5);
slowD2 = stochasticsD(12,5,5);
if BarsSinceExit(1) > 3 then { ##청산신호 후에 1봉이 경과 할때까지 재진입을 금지하라
if stime>=100000 and Stime< 150300 and marketposition==0 then
if MarketPosition == 0 and slowK1 > slowD1 and crossup(slowK2,slowD2) and ((Condition1 == true and BarsSinceExit(1) >= 1) or Condition1 == false) Then
buy("스토12");
//if CrossDown(slowK2,slowD2) and ((Condition1 == true and BarsSinceExit(1) >= 1) or Condition1 == false) Then
//ExitLong("청산매도");
}
}
SetStopProfittarget(1.0,PercentStop);
SetStopTrailing(0.05,1.0,PointStop);
SetStopLoss(1.0,PercentStop);
즐거운 하루되세요
> 외국인 님이 쓴 글입니다.
> 제목 : 수식
> 수정부탁드립니다
청산후 바로재진입이되는데 수정부탁드립니다
//************************************************************************************************************************
If (stime > 91000 and stime < 113000) THEN {
Condition1 = IsExitName("StopProfittarget",1) and ExitDate(1) == sdate;
if BarsSinceExit(1) > 1 then { ##청산신호 후에 1봉이 경과 할때까지 재진입을 금지하라
if stime>=090100 and Stime< 150300 and marketposition==0 then
if C > H[1] and ((Condition1 == true and BarsSinceExit(1) >= 1) or Condition1 == false) Then
buy("매수");
if MarketPosition == 1 Then
sell("반대매도",AtStop,L[BarsSinceEntry]-0.5-PriceScale); ##진입봉의 고가는 H[BarsSinceEntry] if MarketPosition == -1 Then buy("SB",AtStop,H[BarsSinceEntry]+PriceScale);
##매도진입후 매도진입봉의 고가+1틱이상의 시세가 발생하면 매도로 전환
##진입봉의 저가는 L[BarsSinceEntry] if MarketPosition == 1 Then sell("BS",AtStop,L[BarsSinceEntry]-PriceScale);
##매수진입후 매수진입봉의 저가-1틱 이하의 시세가 발생하면 매수로 전환
if C < L[1] and ((Condition1 == true and BarsSinceExit(1) >= 1) or Condition1 == false) Then
sell("매도");
if MarketPosition == -1 Then
buy("반대매수",AtStop,H[BarsSinceEntry]+0.7+PriceScale);
}
}
If (stime > 110000 and stime < 140000) THEN {
Condition1 = IsExitName("StopProfittarget",1) and ExitDate(1) == sdate;
Inputs: PercentRLen(10), OverSold(10), OverBought(90), Trigger(62);
Variables: PcntR(0), AvgValue(0), Setup1(False), Setup2(False);
PcntR = PercentR(PercentRLen);
AvgValue = MA(Close, PercentRLen);
If PcntR < OverSold Then
Setup1 = True;
If PcntR > OverBought Then
Setup1 = False;
If PcntR > OverBought Then
Setup2 = True;
If PcntR < OverSold Then
Setup2 = False;
If Setup1 AND AvgValue > AvgValue[1] AND Crossup(PcntR,Trigger) and ((Condition1 == true and BarsSinceExit(1) >= 1) or Condition1 == false) Then Begin{
Setup1 = False;
Buy ("11시이후매수");
}
End;
If Setup2 AND AvgValue < AvgValue[1] AND CrossDown(PcntR, Trigger) and ((Condition1 == true and BarsSinceExit(1) >= 1) or Condition1 == false) Then Begin{
Setup2 = False;
}
End;
If (stime >= 100000 and stime < 145000) THEN {
Condition1 = IsExitName("StopProfittarget",1) and ExitDate(1) == sdate;
Inputs: Length1(5),Length2(3),Length3(3),OverSold11(30),OverBought11(70);
Variables: KLine(0), DLine(0);
Var : value(0);
KLine = StochasticsK(Length1,Length2);
DLine = StochasticsD(Length1,Length2,Length3);
If Crossup(KLine[5], DLine[5]) AND KLine[5] < OverSold11 AND DLine[5] < OverSold11 and ((Condition1 == true and BarsSinceExit(1) >= 1) or Condition1 == false) Then ##스토매수 신호을 3개봉뒤에 신호나옴
buy("스토매수",AtStop,value);
If (stime >= 100000 and stime < 135000) THEN {
If CrossDown(KLine, DLine) AND KLine > OverBought11 AND DLine < OverBought11 and ((Condition1 == true and BarsSinceExit(1) >= 1) or Condition1 == false) Then
sell ("스토매도",AtStop,value);
}
}
}
If (stime >= 90000 and stime < 150000) THEN {
Condition1 = IsExitName("StopProfittarget",1) and ExitDate(1) == sdate;
Input : Period(12), Period1(5), Period2(5);
value1 = StochasticsK(Period,Period1);
value2 = StochasticsD(Period,Period1,Period2);
If CrossDown(value1, value2) Then {
var1 = C;#데드크로스시 발생시 초기값
var2 = var1[1]; # 직전 데드크로스 구간의 종가 중 최저가
}
#가장 최근 데드크로스 구간의 종가중 최저가 계산
if value1[1] < value2[1] Then{
if C < var1 Then
var1 = L;
}
if CrossUp(value1,value2) Then{
var3 = value1; #골든크로스시 value1값
var4 = var3[1];#직전골든크로스시 value1값
if var3 > var4 and var1 < var2 and ((Condition1 == true and BarsSinceExit(1) >= 1) or Condition1 == false) Then
buy("골든크로스시",atmarket);
}
}
If (stime >= 130000 and stime < 150000) THEN {
Condition1 = IsExitName("StopProfittarget",1) and ExitDate(1) == sdate;
if min(c,O) > ma(c,3) and min(C,H) > ma(c,20) and ((Condition1 == true and BarsSinceExit(1) >= 1) or Condition1 == false) Then
buy("이평매수");
}
If (stime >= 110000 and stime < 150000) THEN {
if max(c,O) < ma(c,5) and max(C,H) > ma(c,20) and ((Condition1 == true and BarsSinceExit(1) >= 1) or Condition1 == false) Then
sell("이평매도");
}
If (stime >= 100000 and stime < 150000) THEN {
var : slowK1(0), slowD1(0), slowK2(0), slowD2(0);
Condition1 = IsExitName("StopProfittarget",1) and ExitDate(1) == sdate;
slowK1 = stochasticsK(12,5);
slowD1 = stochasticsD(20,12,12);
slowK2 = stochasticsK(12,5);
slowD2 = stochasticsD(12,5,5);
if BarsSinceExit(1) > 3 then { ##청산신호 후에 1봉이 경과 할때까지 재진입을 금지하라
if stime>=100000 and Stime< 150300 and marketposition==0 then
if slowK1 > slowD1 and crossup(slowK2,slowD2) and ((Condition1 == true and BarsSinceExit(1) >= 1) or Condition1 == false) Then
buy("스토12");
//if CrossDown(slowK2,slowD2) and ((Condition1 == true and BarsSinceExit(1) >= 1) or Condition1 == false) Then
//ExitLong("청산매도");
}
}
SetStopProfittarget(1.0,PercentStop);
SetStopTrailing(0.05,1.0,PointStop);
SetStopLoss(1.0,PercentStop);
이전글