커뮤니티
수식 문의드립니다.
2018-04-21 12:46:33
143
글번호 118378
안녕하세요
아래와 같이... 추가 진입시 수식 문의드립니다.
1. 포지션 없을때, 스토캐스틱 12이하일때 진입합니다.
If MarketPosition == 0
Then
{
If
and StoK < 12
Then
Buy("1",AtMarket);
}
2. 하락시 추가 진입합니다.
If MarketPosition == 1 Then
{
If MaxEntries == 1 Then
Buy("2",Atlimit,EntryPrice-PriceScale*6);
If MaxEntries == 2 Then
Buy("3",Atlimit,EntryPrice-PriceScale*12);
If MaxEntries == 3 Then
Buy("4",Atlimit,EntryPrice-PriceScale*18);
}
3. 아래와 같이 청산이 발생합니다.
If
StoK > 90
Then
{
SetStopProfittarget(10,PercentStop) ;
} else
{
SetStopProfittarget(0);
}
4. 일부 SetStopProfittarget이 발생해서 청산되면... 그 이후에 추가로 또 진입합니다.
아래부터 잘 안되는것 같은데...
SetStopProfittarget 신호가 발생된 이후에
위의 2번에서 추가로 진입한.. 마지막 가격에서 5틱 높은 가격 이하에서...
mav2 이동평균선을 상향돌파할때 진입이 됐으면 합니다.
If MarketPosition == 1 Then
{
If EntryPrice + 5 > LatestEntryPrice
and CrossUp(C,MAV2)
Then
Buy("111",Atlimit,EntryPrice-PriceScale*2);
}
5. 그리고 4번의 진입이 이루어지면... 아래와 같이 추가로 진입하고 싶습니다.
If MarketPosition == 1 Then
{
If MaxEntries == 2 Then
Buy("111-2",Atlimit,EntryPrice-PriceScale*3);
If MaxEntries == 3 Then
Buy("111-3",Atlimit,EntryPrice-PriceScale*5);
If MaxEntries == 4 Then
Buy("111-4",Atlimit,EntryPrice-PriceScale*7);
}
4번부터 5번까지가 생각한대로 수식이 안되는것 같습니다.
목표는... 1번과 같이 진입하고 2번으로 추가진입되고... 3번으로 일부 혹은 전체 청산.
그리고 일부 보유물량이 있다면,
4번 조건에서 추가 진입하고...
4번 진입가격 기준으로 5번의 추가 진입이 이루어졌으면 합니다.
피라미딩 제한은 총 7로 설정하였습니다.
좋은 주말 보내세요~
답변 1
예스스탁 예스스탁 답변
2018-04-24 11:05:13
안녕하세요
예스스탁입니다.
var : stok(0),mav2(0);
If MarketPosition == 0 and StoK < 12 Then
Buy("1",AtMarket);
If MarketPosition == 1 Then
{
if CurrentContracts > CurrentContracts[1] Then
var1 = 1;
if CurrentContracts < CurrentContracts[1] Then
{
var1 = -1;
}
if countif(var1 == -1,BarsSinceEntry) == 0 then
{
If MaxEntries == 1 Then
Buy("2",Atlimit,EntryPrice-PriceScale*6);
If MaxEntries == 2 Then
Buy("3",Atlimit,EntryPrice-PriceScale*12);
If MaxEntries == 3 Then
Buy("4",Atlimit,EntryPrice-PriceScale*18);
}
If var1 == -1 and C< LatestEntryPrice(0)+PriceScale*5 and CrossUp(C,MAV2) Then
Buy("111",Atlimit,EntryPrice-PriceScale*2);
if var1 == 1 and var1[1] == -1 and LatestEntryName(0) == "111" Then
Condition1 = true;
If Condition1 == true Then
{
If MaxEntries == 2 Then
Buy("111-2",Atlimit,EntryPrice-PriceScale*3);
If MaxEntries == 3 Then
Buy("111-3",Atlimit,EntryPrice-PriceScale*5);
If MaxEntries == 4 Then
Buy("111-4",Atlimit,EntryPrice-PriceScale*7);
}
}
Else
Condition1 = false;
If StoK > 90 then
SetStopProfittarget(10,PercentStop) ;
else
SetStopProfittarget(0);
즐거운 하루되세요
> 이엘성투 님이 쓴 글입니다.
> 제목 : 수식 문의드립니다.
> 안녕하세요
아래와 같이... 추가 진입시 수식 문의드립니다.
1. 포지션 없을때, 스토캐스틱 12이하일때 진입합니다.
If MarketPosition == 0
Then
{
If
and StoK < 12
Then
Buy("1",AtMarket);
}
2. 하락시 추가 진입합니다.
If MarketPosition == 1 Then
{
If MaxEntries == 1 Then
Buy("2",Atlimit,EntryPrice-PriceScale*6);
If MaxEntries == 2 Then
Buy("3",Atlimit,EntryPrice-PriceScale*12);
If MaxEntries == 3 Then
Buy("4",Atlimit,EntryPrice-PriceScale*18);
}
3. 아래와 같이 청산이 발생합니다.
If
StoK > 90
Then
{
SetStopProfittarget(10,PercentStop) ;
} else
{
SetStopProfittarget(0);
}
4. 일부 SetStopProfittarget이 발생해서 청산되면... 그 이후에 추가로 또 진입합니다.
아래부터 잘 안되는것 같은데...
SetStopProfittarget 신호가 발생된 이후에
위의 2번에서 추가로 진입한.. 마지막 가격에서 5틱 높은 가격 이하에서...
mav2 이동평균선을 상향돌파할때 진입이 됐으면 합니다.
If MarketPosition == 1 Then
{
If EntryPrice + 5 > LatestEntryPrice
and CrossUp(C,MAV2)
Then
Buy("111",Atlimit,EntryPrice-PriceScale*2);
}
5. 그리고 4번의 진입이 이루어지면... 아래와 같이 추가로 진입하고 싶습니다.
If MarketPosition == 1 Then
{
If MaxEntries == 2 Then
Buy("111-2",Atlimit,EntryPrice-PriceScale*3);
If MaxEntries == 3 Then
Buy("111-3",Atlimit,EntryPrice-PriceScale*5);
If MaxEntries == 4 Then
Buy("111-4",Atlimit,EntryPrice-PriceScale*7);
}
4번부터 5번까지가 생각한대로 수식이 안되는것 같습니다.
목표는... 1번과 같이 진입하고 2번으로 추가진입되고... 3번으로 일부 혹은 전체 청산.
그리고 일부 보유물량이 있다면,
4번 조건에서 추가 진입하고...
4번 진입가격 기준으로 5번의 추가 진입이 이루어졌으면 합니다.
피라미딩 제한은 총 7로 설정하였습니다.
좋은 주말 보내세요~
다음글
이전글