커뮤니티
수정 부탁드립니다.
2019-10-16 18:21:40
194
글번호 132803
안녕하세요?
아래 수식에 추가하고 싶은 부분이 있어서 부탁 드립니다.
1. 하루 매매횟수를 외부변수(틱) 으로 지정.
2. (외부변수)회 연속 수익시 매매종료 or (외부변수)회 손실시 매매종료
혹시 둘다 같이 가능한가요? 불가능하면 따로 부탁드립니다.
부탁드립니다. 감사합니다.
Input : 손절 (1), 익절 (1), 종가청산시간 (1515), 역진입감시봉 (3);
var : isToBuy(False), isToSell(False), length(0);
var : entryIdx(0), enterLength(0);
length = c - o;
isToBuy = length == 0 and c[1] < o;
isToSell = length == 0 and c[1] > o;
if MarketPosition == 0 then {
if isToBuy then {
Buy("수진");
entryIdx = Index;
}
if isToSell then {
Sell("도진");
entryIdx = Index;
}
}
else if MarketPosition == 1 then {
if Index <= entryIdx + 역진입감시봉 and length > 0 then {
Sell("수청도역진");
}
}
else if MarketPosition == -1 then {
if Index <= entryIdx + 역진입감시봉 and length < 0 then {
Buy("도청수역진");
}
}
SetStopLoss(손절, PointStop);
SetStopProfittarget(익절, PointStop);
SetStopEndofday(종가청산시간);
답변 1
예스스탁 예스스탁 답변
2019-10-17 09:18:02
안녕하세요
예스스탁입니다.
Input : 손절 (1), 익절 (1), 종가청산시간 (1515), 역진입감시봉 (3), 매매횟수(3),연속수익(3),연속손실(3);
var : isToBuy(False), isToSell(False), length(0);
var : entryIdx(0), enterLength(0),entry(0),loss(0),Profit(0);
if bdate != bdate[1] Then
{
entry = entry+1;
Loss = Loss+1;
Profit = Profit +1;
}
if MarketPosition != 0 and MarketPosition != MarketPosition[1] Then
entry = entry+1;
length = c - o;
isToBuy = length == 0 and c[1] < o;
isToSell = length == 0 and c[1] > o;
if TotalTrades[1] > TotalTrades[1] Then
{
if PositionProfit(1) > 0 Then
Profit = Profit+1;
Else
Profit = 0;
if PositionProfit(1) < 0 Then
Loss = Loss+1;
Else
Loss = 0;
}
if MarketPosition == 0 and entry < 매매횟수 then
{
if isToBuy then
{
Buy("수진");
entryIdx = Index;
}
if isToSell then
{
Sell("도진");
entryIdx = Index;
}
}
if MarketPosition == 1 and entry < 매매횟수 and Profit < 연속수익 and Loss < 연속손실 then
{
if Index <= entryIdx + 역진입감시봉 and length > 0 then
{
Sell("수청도역진");
}
}
if MarketPosition == -1 and Profit < 연속수익 and Loss < 연속손실 then
{
if Index <= entryIdx + 역진입감시봉 and length < 0 then
{
Buy("도청수역진");
}
}
SetStopLoss(손절, PointStop);
SetStopProfittarget(익절, PointStop);
SetStopEndofday(종가청산시간);
즐거운 하루되세요
> 대구어린울프 님이 쓴 글입니다.
> 제목 : 수정 부탁드립니다.
> 안녕하세요?
아래 수식에 추가하고 싶은 부분이 있어서 부탁 드립니다.
1. 하루 매매횟수를 외부변수(틱) 으로 지정.
2. (외부변수)회 연속 수익시 매매종료 or (외부변수)회 손실시 매매종료
혹시 둘다 같이 가능한가요? 불가능하면 따로 부탁드립니다.
부탁드립니다. 감사합니다.
Input : 손절 (1), 익절 (1), 종가청산시간 (1515), 역진입감시봉 (3);
var : isToBuy(False), isToSell(False), length(0);
var : entryIdx(0), enterLength(0);
length = c - o;
isToBuy = length == 0 and c[1] < o;
isToSell = length == 0 and c[1] > o;
if MarketPosition == 0 then {
if isToBuy then {
Buy("수진");
entryIdx = Index;
}
if isToSell then {
Sell("도진");
entryIdx = Index;
}
}
else if MarketPosition == 1 then {
if Index <= entryIdx + 역진입감시봉 and length > 0 then {
Sell("수청도역진");
}
}
else if MarketPosition == -1 then {
if Index <= entryIdx + 역진입감시봉 and length < 0 then {
Buy("도청수역진");
}
}
SetStopLoss(손절, PointStop);
SetStopProfittarget(익절, PointStop);
SetStopEndofday(종가청산시간);
이전글