커뮤니티
답변이 없으셔서 다시 올려요.
2017-05-11 16:24:30
149
글번호 109469
1. 예스트레이더에서는 "LatestEntryPrice(0)" 함수가 사용가능한데,
제일로 HTS 예스랭귀지 편집기에서는 선언되지 않은 이름이라고 나오네요.
제일로에서 LatestEntryPrice(0) 함수를 이용할 방법이 없을까요?
아니면 다른 함수로 비슷하게 구현할수있는지요...?
2. 혹시 나열해보면 원하는 시스템이 나올까 풀어서 써봤는데요...
신호 타입을 atlimit 으로하면 1단계이상 진입조차 하질않네요...
if MarketPosition == 1 Then{
ExitLong("bp",atlimit,AvgEntryPrice+PriceScale*25);
ExitLong("bl",AtStop,EntryPrice-PriceScale*300);
if MaxEntries == 1 then
buy("b2",AtStop,EntryPrice-PriceScale*20,CurrentContracts*2);
if MaxEntries == 2 then
buy("b3",AtStop,EntryPrice-pricescale*40,CurrentContracts*2);
if MaxEntries == 3 then
buy("b4",AtStop,EntryPrice-pricescale*80,CurrentContracts*2);
if MaxEntries == 4 then
buy("b5",AtStop,EntryPrice-pricescale*100,CurrentContracts*2);
원하던 그림은, 첫 매수 이후 20핍 떨어질때마다 단계별로 매수 재진입인데
첨부한 사진처럼 뒤죽박죽으로 들어가지네요...
조언 부탁드립니다...
> 예스스탁 님이 쓴 글입니다.
> 제목 : Re : 수식 부탁드립니다~
>
안녕하세요
예스스탁입니다.
피라미딩을 모든진입신호 허용으로 설정하고 적용하시면 됩니다.
input : P(10),BBP(20),dv(2);
var : RSIV(9),BBup(0),BBdn(0);
RSIV = RSI(P);
BBup = BollBandUp(BBP,dv);
BBdn = BollBandDown(BBP,dv);
if MarketPosition <= 0 and RSIV < 30 and CrossDown(c,BBdn) Then
buy("b",OnClose,def,2);
if MarketPosition >= 0 and RSIV > 70 and crossup(c,BBup) Then
sell("s",OnClose,def,2);
if MarketPosition == 1 Then{
ExitLong("bp",atlimit,AvgEntryPrice+PriceScale*25);
ExitLong("bl",AtStop,EntryPrice-PriceScale*300);
if MaxEntries < 5 then
buy("bb",atlimit,LatestEntryPrice(0)-PriceScale*20,CurrentContracts*2);
}
if MarketPosition == -1 Then{
ExitShort("sp",atlimit,AvgEntryPrice-PriceScale*25);
ExitShort("sl",AtStop,EntryPrice+PriceScale*300);
if MaxEntries < 5 then
sell("ss",AtLimit,LatestEntryPrice(0)+PriceScale*20,CurrentContracts*2);
}
즐거운 하루되세요
- 1. 110009_dfdfdfdf.PNG (0.00 MB)
답변 1
예스스탁 예스스탁 답변
2017-05-11 17:52:32
안녕하세요
예스스탁입니다.
1
제일로는 이전버전 랭귀지가 탑제가 되어 있어 해당 함수가 없습니다.
해당 함수가 없으면 피라미딩시 최근 진입의 정확한 값을 알수는 없습니다.
아래와 같은 구분으로 수량이 증가하면(진입이나 추가진입이 발생한것이므로)
종가등 진입과 가까운 가격을 저장해 사용하실수 밖에 없습니다
if CurrentContracts > CurrentContracts[1] Then
var = C;
2
매수에서 가격이 하락할때 진입은 atlimit을 사용하셔야 합니다.
수식에 따로 문제는 없습니다. 적용해 보면 정상적으로 신호 발생합니다.
피라미딩을 하는 수식은 적용시 시스템 트레이딩 설정창의 피라미딩 탭에서
피라미딩을 설정하고 적용하셔야 합니다.
해당식은 다른진입신호만허용으로 설정하고 적용하시면 됩니다.
if MarketPosition == 1 Then{
ExitLong("bp",atlimit,AvgEntryPrice+PriceScale*25);
ExitLong("bl",AtStop,EntryPrice-PriceScale*300);
if MaxEntries == 1 then
buy("b2",AtLimit,EntryPrice-PriceScale*20,CurrentContracts*2);
if MaxEntries == 2 then
buy("b3",AtLimit,EntryPrice-pricescale*40,CurrentContracts*2);
if MaxEntries == 3 then
buy("b4",AtLimit,EntryPrice-pricescale*80,CurrentContracts*2);
if MaxEntries == 4 then
buy("b5",AtLimit,EntryPrice-pricescale*100,CurrentContracts*2);
}
즐거운 하루되세요
> 뚜뚜뚜둥 님이 쓴 글입니다.
> 제목 : 답변이 없으셔서 다시 올려요.
> 1. 예스트레이더에서는 "LatestEntryPrice(0)" 함수가 사용가능한데,
제일로 HTS 예스랭귀지 편집기에서는 선언되지 않은 이름이라고 나오네요.
제일로에서 LatestEntryPrice(0) 함수를 이용할 방법이 없을까요?
아니면 다른 함수로 비슷하게 구현할수있는지요...?
2. 혹시 나열해보면 원하는 시스템이 나올까 풀어서 써봤는데요...
신호 타입을 atlimit 으로하면 1단계이상 진입조차 하질않네요...
if MarketPosition == 1 Then{
ExitLong("bp",atlimit,AvgEntryPrice+PriceScale*25);
ExitLong("bl",AtStop,EntryPrice-PriceScale*300);
if MaxEntries == 1 then
buy("b2",AtStop,EntryPrice-PriceScale*20,CurrentContracts*2);
if MaxEntries == 2 then
buy("b3",AtStop,EntryPrice-pricescale*40,CurrentContracts*2);
if MaxEntries == 3 then
buy("b4",AtStop,EntryPrice-pricescale*80,CurrentContracts*2);
if MaxEntries == 4 then
buy("b5",AtStop,EntryPrice-pricescale*100,CurrentContracts*2);
원하던 그림은, 첫 매수 이후 20핍 떨어질때마다 단계별로 매수 재진입인데
첨부한 사진처럼 뒤죽박죽으로 들어가지네요...
조언 부탁드립니다...
> 예스스탁 님이 쓴 글입니다.
> 제목 : Re : 수식 부탁드립니다~
>
안녕하세요
예스스탁입니다.
피라미딩을 모든진입신호 허용으로 설정하고 적용하시면 됩니다.
input : P(10),BBP(20),dv(2);
var : RSIV(9),BBup(0),BBdn(0);
RSIV = RSI(P);
BBup = BollBandUp(BBP,dv);
BBdn = BollBandDown(BBP,dv);
if MarketPosition <= 0 and RSIV < 30 and CrossDown(c,BBdn) Then
buy("b",OnClose,def,2);
if MarketPosition >= 0 and RSIV > 70 and crossup(c,BBup) Then
sell("s",OnClose,def,2);
if MarketPosition == 1 Then{
ExitLong("bp",atlimit,AvgEntryPrice+PriceScale*25);
ExitLong("bl",AtStop,EntryPrice-PriceScale*300);
if MaxEntries < 5 then
buy("bb",atlimit,LatestEntryPrice(0)-PriceScale*20,CurrentContracts*2);
}
if MarketPosition == -1 Then{
ExitShort("sp",atlimit,AvgEntryPrice-PriceScale*25);
ExitShort("sl",AtStop,EntryPrice+PriceScale*300);
if MaxEntries < 5 then
sell("ss",AtLimit,LatestEntryPrice(0)+PriceScale*20,CurrentContracts*2);
}
즐거운 하루되세요
다음글
이전글