커뮤니티
수식 정정 부탁드립니다^^
2014-11-16 19:08:59
156
글번호 80406
수고 많으십니다. 주말을 잘 보내셨는지요^^ 항상 감사한 마음으로 시스템 트레이딩을 실전에서 잘 활용하고 있습니다. 한가지 더 부탁 드리고자 합니다.
아래 수식에서 매수, 또는 매도 진입 이후 체결 즉시 매수 청산 5호가 위, 또는 매도 청산 5호가 아래로 설정하고자 합니다. 변수처리 하였으면 합니다.
input : RSIP(14),RSIsig(6),sto1(18),sto2(6),sto3(6),N(0);
var : RSIV(0),RSIS(0),STOK(0),STOD(0);
RSIV = RSI(RSIP);
RSIS = ma(RSIV,RSISig);
STOK = StochasticsK(sto1,sto2);
STOD = StochasticsD(sto1,sto2,sto3);
if RSIV <= 46 and CrossDown(STOK,13) Then
buy("매수1",AtStop,NextBarOpen+PriceScale*N);
if RSIV >= 54 and CrossUp(STOK,87) Then
ExitLong("매수청산1",AtStop,NextBarOpen-PriceScale*N);
if RSIV >= 54 and CrossUp(STOK,87) Then
Sell("매도1",AtStop,NextBarOpen-PriceScale*N);
if RSIV <= 46 and CrossDown(STOK,13) Then
ExitShort("매도청산1",AtStop,NextBarOpen+PriceScale*N);
if RSIV <= 46 and CrossDown(STOK,15) Then
buy("매수2",AtStop,NextBarOpen+PriceScale*N);
if RSIV >= 54 and CrossUp(STOK,85) Then
ExitLong("매수청산2",AtStop,NextBarOpen-PriceScale*N);
if RSIV >= 54 and CrossUp(STOK,85) Then
Sell("매도2",AtStop,NextBarOpen-PriceScale*N);
if RSIV <= 46 and CrossDown(STOK,15) Then
ExitShort("매도청산2",AtStop,NextBarOpen+PriceScale*N);
답변 1
예스스탁 예스스탁 답변
2014-11-17 10:56:25
안녕하세요
예스스탁입니다.
문의하신 내용은 시스템으로 가능하지 않는 부분입니다.
시스템은 미리 어떤 가격으로 주문을 내는 기능은 없습니다.
시스템은 수신되는 시세가 지정한 가격조건이 만족할때 그때 신호가 발생합니다.
5틱 손실시 청산식만 추가해 드립니다.
input : RSIP(14),RSIsig(6),sto1(18),sto2(6),sto3(6),N(0),loss(5);
var : RSIV(0),RSIS(0),STOK(0),STOD(0);
RSIV = RSI(RSIP);
RSIS = ma(RSIV,RSISig);
STOK = StochasticsK(sto1,sto2);
STOD = StochasticsD(sto1,sto2,sto3);
if RSIV <= 46 and CrossDown(STOK,13) Then
buy("매수1",AtStop,NextBarOpen+PriceScale*N);
if RSIV >= 54 and CrossUp(STOK,87) Then
ExitLong("매수청산1",AtStop,NextBarOpen-PriceScale*N);
if RSIV >= 54 and CrossUp(STOK,87) Then
Sell("매도1",AtStop,NextBarOpen-PriceScale*N);
if RSIV <= 46 and CrossDown(STOK,13) Then
ExitShort("매도청산1",AtStop,NextBarOpen+PriceScale*N);
if RSIV <= 46 and CrossDown(STOK,15) Then
buy("매수2",AtStop,NextBarOpen+PriceScale*N);
if RSIV >= 54 and CrossUp(STOK,85) Then
ExitLong("매수청산2",AtStop,NextBarOpen-PriceScale*N);
if RSIV >= 54 and CrossUp(STOK,85) Then
Sell("매도2",AtStop,NextBarOpen-PriceScale*N);
if RSIV <= 46 and CrossDown(STOK,15) Then
ExitShort("매도청산2",AtStop,NextBarOpen+PriceScale*N);
SetStopLoss(PriceScale*loss,PointStop);
즐거운 하루되세요
> 하리마우 님이 쓴 글입니다.
> 제목 : 수식 정정 부탁드립니다^^
> 수고 많으십니다. 주말을 잘 보내셨는지요^^ 항상 감사한 마음으로 시스템 트레이딩을 실전에서 잘 활용하고 있습니다. 한가지 더 부탁 드리고자 합니다.
아래 수식에서 매수, 또는 매도 진입 이후 체결 즉시 매수 청산 5호가 위, 또는 매도 청산 5호가 아래로 설정하고자 합니다. 변수처리 하였으면 합니다.
input : RSIP(14),RSIsig(6),sto1(18),sto2(6),sto3(6),N(0);
var : RSIV(0),RSIS(0),STOK(0),STOD(0);
RSIV = RSI(RSIP);
RSIS = ma(RSIV,RSISig);
STOK = StochasticsK(sto1,sto2);
STOD = StochasticsD(sto1,sto2,sto3);
if RSIV <= 46 and CrossDown(STOK,13) Then
buy("매수1",AtStop,NextBarOpen+PriceScale*N);
if RSIV >= 54 and CrossUp(STOK,87) Then
ExitLong("매수청산1",AtStop,NextBarOpen-PriceScale*N);
if RSIV >= 54 and CrossUp(STOK,87) Then
Sell("매도1",AtStop,NextBarOpen-PriceScale*N);
if RSIV <= 46 and CrossDown(STOK,13) Then
ExitShort("매도청산1",AtStop,NextBarOpen+PriceScale*N);
if RSIV <= 46 and CrossDown(STOK,15) Then
buy("매수2",AtStop,NextBarOpen+PriceScale*N);
if RSIV >= 54 and CrossUp(STOK,85) Then
ExitLong("매수청산2",AtStop,NextBarOpen-PriceScale*N);
if RSIV >= 54 and CrossUp(STOK,85) Then
Sell("매도2",AtStop,NextBarOpen-PriceScale*N);
if RSIV <= 46 and CrossDown(STOK,15) Then
ExitShort("매도청산2",AtStop,NextBarOpen+PriceScale*N);