커뮤니티
진입제한 및 매수가격(진입가격)
2009-02-15 11:17:39
804
글번호 20242
아래 식에서, 강제청산후 10분봉 후에 매매 이루어지도록 식을 작성한건데,
모가 잘몬됬는지, 매수신호 자체가 나오지 않습니다.
또한 매매시에 신호발생한 봉의 다음봉 시가로 매수가가 나가던데, 신호발생 봉의 종가로 매수가가 나가도록 하는 방법도 궁금합니다.
if isExitname("exitlong",1) or isExitname("SetStopEndofday",1) then
{
if barssinceExit(1) >= 10 then
{
if Stime >= 92100 and stime <= 120000 Then
{
if c >= dayclose(1)*(1-0.121) and disparity(20) <= 98 and disparity(20) > 95 Then
buy("b2");
if c >= dayclose(1)*(1-0.121) and disparity(20) <= 95 Then
buy("b3");
}
}
}
if MarketPosition() == 1 and IsEntryName("b2") Then
{
exitlong("b2수익",atlimit,EntryPrice()*1.015);
exitlong("b2손절",AtStop,EntryPrice*0.985);
if stime == 123000 Then
exitlong();
}
if MarketPosition() == 1 and IsEntryName("b3") Then
{
exitlong("b3수익",atlimit,EntryPrice()*1.03);
exitlong("b3손절",AtStop,EntryPrice*0.985);
if stime == 123000 Then
exitlong();
}
/********************************************************************************************************************
********************************************************************************************************************/
SetStopEndofday(123000);
답변 1
예스스탁 예스스탁 답변
2009-02-16 13:44:21
안녕하세요
예스스탁입니다.
1.
isExitname은 청산식의 이름을 가져와 식을 작성할 때 사용됩니다.
exitlong/SetStopEndofday은 청산함수이며 이름이 아닙니다.
또한 차트상 가장 먼저 일어나는 진입은 전 진입이 없으므로
청산도 없습니다. 그러므로 첫진입과 그 이후진입을 구분해서 작성하셔야 합니다.
손절매나 목표이익,당일청산등의 강제청산함수의 이름은
set을 제외하시면 됩니다.
setstopendofday --> isExitname("StopEndofday",1)
아래는 수정된 식입니다.
If TotalTrades == 0 Then{
if Stime >= 92100 and stime <= 120000 Then
{
if c >= dayclose(1)*(1-0.121) and disparity(20) <= 98 and disparity(20) > 95 Then
buy("b#2");
if c >= dayclose(1)*(1-0.121) and disparity(20) <= 95 Then
buy("b#3");
}
}
if TotalTrades > 0 Then{
if isExitname("StopEndofday",1) or isExitname("b2수익",1) or isExitname("b3수익",1) or isExitname("b2손절",1) or isExitname("b3손절",1) then
{
if barssinceExit(1) >= 10 then
{
if Stime >= 92100 and stime <= 120000 Then
{
if c >= dayclose(1)*(1-0.121) and disparity(20) <= 98 and disparity(20) > 95 Then
buy("b2");
if c >= dayclose(1)*(1-0.121) and disparity(20) <= 95 Then
buy("b3");
}
}
}
}
if MarketPosition() == 1 and IsEntryName("b2") Then
{
exitlong("b2수익",atlimit,EntryPrice()*1.015);
exitlong("b2손절",AtStop,EntryPrice*0.985);
if stime == 123000 Then
exitlong();
}
if MarketPosition() == 1 and IsEntryName("b3") Then
{
exitlong("b3수익",atlimit,EntryPrice()*1.03);
exitlong("b3손절",AtStop,EntryPrice*0.985);
if stime == 123000 Then
exitlong();
}
SetStopEndofday(123000);
2.
if문은 봉완성시에 최종 조건만족유무를 판단하며
하나의 봉의 완성시점은 다음봉 시가가 수신되었을 때이므로
해당부분은 수정될 수 없습니다.
즐거운 하루되세요
> CJ_pyometra 님이 쓴 글입니다.
> 제목 : 진입제한 및 매수가격(진입가격)
> 아래 식에서, 강제청산후 10분봉 후에 매매 이루어지도록 식을 작성한건데,
모가 잘몬됬는지, 매수신호 자체가 나오지 않습니다.
또한 매매시에 신호발생한 봉의 다음봉 시가로 매수가가 나가던데, 신호발생 봉의 종가로 매수가가 나가도록 하는 방법도 궁금합니다.
if isExitname("exitlong",1) or isExitname("SetStopEndofday",1) then
{
if barssinceExit(1) >= 10 then
{
if Stime >= 92100 and stime <= 120000 Then
{
if c >= dayclose(1)*(1-0.121) and disparity(20) <= 98 and disparity(20) > 95 Then
buy("b2");
if c >= dayclose(1)*(1-0.121) and disparity(20) <= 95 Then
buy("b3");
}
}
}
if MarketPosition() == 1 and IsEntryName("b2") Then
{
exitlong("b2수익",atlimit,EntryPrice()*1.015);
exitlong("b2손절",AtStop,EntryPrice*0.985);
if stime == 123000 Then
exitlong();
}
if MarketPosition() == 1 and IsEntryName("b3") Then
{
exitlong("b3수익",atlimit,EntryPrice()*1.03);
exitlong("b3손절",AtStop,EntryPrice*0.985);
if stime == 123000 Then
exitlong();
}
/********************************************************************************************************************
********************************************************************************************************************/
SetStopEndofday(123000);
다음글
이전글