커뮤니티
문의 드립니다.
2014-11-12 06:47:36
135
글번호 80296
항상 도움 주셔서 감사합니다.
문1) 시간대별로 다르게 스탑로스를 하고 싶습니다.
코딩 해봤는데 잘 안됩니다.
도움 부탁드립니다.
#=============================================
Input : 손실폭(0.0011), 수익폭(0.0026),손실폭2(0.0003), 수익폭2(0.0016),
손실폭3(0.0014), 수익폭3(0.0024),손실폭4(0.0012), 수익폭4(0.0027 ;
Var : 이평3(0), 이평5(0), 이평10(0) ;
이평3 = ma(c,3) ;
이평5 = ma(c,5) ;
이평10 = ma(c,10) ;
if sTime >= 070000 or stime < 060000 Then {
If MarketPosition == 0 Then {
If crossup(이평3,이평5) then
Buy("Buy");
}
If MarketPosition == 0 Then {
If crossup(이평5,이평10) then
Buy("Buy2");
}
If MarketPosition == 1 Then {
If crossdown(이평3,이평5) then
exitlong("ext");
}
If MarketPosition == 0 Then {
If crossdown(이평3,이평5) then
Sell("Sell");
}
If MarketPosition == 0 Then {
If crossdown(이평5,이평10) then
Sell("Sell2");
}
If MarketPosition == -1 Then {
If crossup(이평3,이평5) then
exitshort("out");
}
if stime == 060000 or (stime > 060000 and stime[1] < 060000) Then{
ExitLong("B_Off");
ExitShort("S_Off");
}
#--------------------------------------------------
if sTime >= 070000 and stime <= 160000 Then {
#--------------------------------------------------
if IsEntryName("Buy") == true or IsEntryName("Sell") == true Then {
SetStopProfittarget(수익폭,PointStop);
SetStopLoss(손실폭,PointStop);
}
Else{
SetStopProfittarget(수익폭2,PointStop);
SetStopLoss(손실폭2,PointStop);
}
#--------------------------------------------------
} # 오후 4시이후 다음달 새벽까지
#--------------------------------------------------
else {
if IsEntryName("Buy2") == true or IsEntryName("Sell2") == true Then {
SetStopProfittarget(수익폭3,PointStop);
SetStopLoss(손실폭3,PointStop);
}
Else{
SetStopProfittarget(수익폭4,PointStop);
SetStopLoss(손실폭4,PointStop);
}
#--------------------------------------------------
}
#--------------------------------------------------
도움 부탁드립니다.
답변 1
예스스탁 예스스탁 답변
2014-11-12 10:00:35
안녕하세요
예스스탁입니다.
Input : 손실폭(0.0011), 수익폭(0.0026),손실폭2(0.0003), 수익폭2(0.0016),
손실폭3(0.0014), 수익폭3(0.0024),손실폭4(0.0012), 수익폭4(0.0027) ;
Var : 이평3(0), 이평5(0), 이평10(0) ;
이평3 = ma(c,3) ;
이평5 = ma(c,5) ;
이평10 = ma(c,10) ;
if sTime >= 070000 or stime < 060000 Then {
If MarketPosition == 0 Then {
If crossup(이평3,이평5) then
Buy("Buy");
}
If MarketPosition == 0 Then {
If crossup(이평5,이평10) then
Buy("Buy2");
}
If MarketPosition == 1 Then {
If crossdown(이평3,이평5) then
exitlong("ext");
}
If MarketPosition == 0 Then {
If crossdown(이평3,이평5) then
Sell("Sell");
}
If MarketPosition == 0 Then {
If crossdown(이평5,이평10) then
Sell("Sell2");
}
If MarketPosition == -1 Then {
If crossup(이평3,이평5) then
exitshort("out");
}
}
if stime == 060000 or (stime > 060000 and stime[1] < 060000) Then{
ExitLong("B_Off");
ExitShort("S_Off");
}
#--------------------------------------------------
if sTime >= 070000 and stime <= 160000 Then
{
if IsEntryName("Buy") == true or IsEntryName("Sell") == true Then
{
SetStopProfittarget(수익폭,PointStop);
SetStopLoss(손실폭,PointStop);
}
Else
{
SetStopProfittarget(수익폭2,PointStop);
SetStopLoss(손실폭2,PointStop);
}
}
else
{
if IsEntryName("Buy2") == true or IsEntryName("Sell2") == true Then
{
SetStopProfittarget(수익폭3,PointStop);
SetStopLoss(손실폭3,PointStop);
}
Else
{
SetStopProfittarget(수익폭4,PointStop);
SetStopLoss(손실폭4,PointStop);
}
}
즐거운 하루되세요
> 양치기 님이 쓴 글입니다.
> 제목 : 문의 드립니다.
> 항상 도움 주셔서 감사합니다.
문1) 시간대별로 다르게 스탑로스를 하고 싶습니다.
코딩 해봤는데 잘 안됩니다.
도움 부탁드립니다.
#=============================================
Input : 손실폭(0.0011), 수익폭(0.0026),손실폭2(0.0003), 수익폭2(0.0016),
손실폭3(0.0014), 수익폭3(0.0024),손실폭4(0.0012), 수익폭4(0.0027 ;
Var : 이평3(0), 이평5(0), 이평10(0) ;
이평3 = ma(c,3) ;
이평5 = ma(c,5) ;
이평10 = ma(c,10) ;
if sTime >= 070000 or stime < 060000 Then {
If MarketPosition == 0 Then {
If crossup(이평3,이평5) then
Buy("Buy");
}
If MarketPosition == 0 Then {
If crossup(이평5,이평10) then
Buy("Buy2");
}
If MarketPosition == 1 Then {
If crossdown(이평3,이평5) then
exitlong("ext");
}
If MarketPosition == 0 Then {
If crossdown(이평3,이평5) then
Sell("Sell");
}
If MarketPosition == 0 Then {
If crossdown(이평5,이평10) then
Sell("Sell2");
}
If MarketPosition == -1 Then {
If crossup(이평3,이평5) then
exitshort("out");
}
if stime == 060000 or (stime > 060000 and stime[1] < 060000) Then{
ExitLong("B_Off");
ExitShort("S_Off");
}
#--------------------------------------------------
if sTime >= 070000 and stime <= 160000 Then {
#--------------------------------------------------
if IsEntryName("Buy") == true or IsEntryName("Sell") == true Then {
SetStopProfittarget(수익폭,PointStop);
SetStopLoss(손실폭,PointStop);
}
Else{
SetStopProfittarget(수익폭2,PointStop);
SetStopLoss(손실폭2,PointStop);
}
#--------------------------------------------------
} # 오후 4시이후 다음달 새벽까지
#--------------------------------------------------
else {
if IsEntryName("Buy2") == true or IsEntryName("Sell2") == true Then {
SetStopProfittarget(수익폭3,PointStop);
SetStopLoss(손실폭3,PointStop);
}
Else{
SetStopProfittarget(수익폭4,PointStop);
SetStopLoss(손실폭4,PointStop);
}
#--------------------------------------------------
}
#--------------------------------------------------
도움 부탁드립니다.