커뮤니티
수식추가 부탁드립니다.
2019-07-24 20:32:58
131
글번호 130612
안녕하세요? 간단한 수식추가 하나 부탁 드리겠습니다.
아래의 수식에 TS가 추가 되었으면 합니다.
***추가하고싶은것
1. (변수)틱 도달이후 TS발동.
2. (변수)틱이 떨어지면 수익을 보존하여 청산.
단, (변수)틱까지 떨어지지않으면 기존에 설정한 익절에 청산.
부탁드리겠습니다.
----------------------------------------------------------------------------------------
input : 익절(1),손절(1);
var1 = abs(C-O);
if MarketPosition == 0 and
countif(C>O,2) == 2 and
var1 > var1[1] Then
buy();
if MarketPosition == 0 and
countif(C<O,2) == 2 and
var1 > var1[1] Then
sell();
SetStopProfittarget(익절,PointStop);
SetStopLoss(손절,PointStop);
답변 1
예스스탁 예스스탁 답변
2019-07-25 14:31:45
안녕하세요
예스스탁입니다.
input : 익절(1),손절(1),최소수익틱수(10),감소틱수(5);
var1 = abs(C-O);
if MarketPosition == 0 and
countif(C>O,2) == 2 and
var1 > var1[1] Then
buy();
if MarketPosition == 0 and
countif(C<O,2) == 2 and
var1 > var1[1] Then
sell();
if MarketPosition == 1 and
highest(H,BarsSinceEntry) >= EntryPrice+PriceScale*최소수익틱수 Then
ExitLong("bts",AtStop,highest(H,BarsSinceEntry)-PriceScale*감소틱수);
if MarketPosition ==1 and
Lowest(L,BarsSinceEntry) <= EntryPrice-PriceScale*최소수익틱수 Then
ExitShort("sts",AtStop,Lowest(L,BarsSinceEntry)+PriceScale*감소틱수);
SetStopProfittarget(익절,PointStop);
SetStopLoss(손절,PointStop);
즐거운 하루되세요
> 대구어린울프 님이 쓴 글입니다.
> 제목 : 수식추가 부탁드립니다.
> 안녕하세요? 간단한 수식추가 하나 부탁 드리겠습니다.
아래의 수식에 TS가 추가 되었으면 합니다.
***추가하고싶은것
1. (변수)틱 도달이후 TS발동.
2. (변수)틱이 떨어지면 수익을 보존하여 청산.
단, (변수)틱까지 떨어지지않으면 기존에 설정한 익절에 청산.
부탁드리겠습니다.
----------------------------------------------------------------------------------------
input : 익절(1),손절(1);
var1 = abs(C-O);
if MarketPosition == 0 and
countif(C>O,2) == 2 and
var1 > var1[1] Then
buy();
if MarketPosition == 0 and
countif(C<O,2) == 2 and
var1 > var1[1] Then
sell();
SetStopProfittarget(익절,PointStop);
SetStopLoss(손절,PointStop);