답변완료
문의
리버스거래 수식이며 피라미딩은 max 3개입니다.
문의1)
b1-b2-b3-s1-s2-s3-b1-b2-b3...이런 패턴을 예상했으나
이러한 패턴을 포함하여
b1-b2-b3-s2-s3-s3-b3-b1-b2...처럼
뒤집을 때 s1보다 s2가 먼저 진입하며
피라미딩도 s2-s3-s3 처럼 s3가 중복되는 진입도 있으며
피라미딩 순서도 b3-b1-b2 처럼 순차적이 아닌 경우도 있습니다.
요청내용
첫째, 포지션을 뒤집을 때는 b1이나 s1부터 시작되고
둘째, s2-s3-s3 에서 s3 가 두번 들어가는데 동일 진입명은 피라미딩에서 제외하고
셋째, b1-b2-b3나 s1-s2-s3 처럼 순차적으로 피라미딩이 되게 수식을 수정하여 주십시요.
************************************************************************************
input:이평1(35),이평2(105),이평3(75),이평4(95);
input:이평5(15),이평6(10),이평7(70),이평8(10);
input:이평9(5),이평10(10),이평11(55),이평12(30);
var : v1(0,data2),v2(0,data2);
var : v3(0,data3),v4(0,data3);
var : v5(0,data2),v6(0,data2);
var : v7(0,data3),v8(0,data3);
var : v9(0,data2),v10(0,data2);
var : v11(0,data3),v12(0,data3);
v1 = data2(ma(C,이평1));
v2 = data2(ma(C,이평2));
v3 = data3(ma(C,이평3));
v4 = data3(ma(C,이평4));
v5 = data2(ma(C,이평5));
v6 = data2(ma(C,이평6));
v7 = data3(ma(C,이평7));
v8 = data3(ma(C,이평8));
v9 = data2(ma(C,이평9));
v10 = data2(ma(C,이평10));
v11 = data3(ma(C,이평11));
v12 = data3(ma(C,이평12));
if MarketPosition <= 0 and CrossUp(v1,v2) or CrossUp(v3,v4) Then
BuY("b1");
if MarketPosition == 1 and MaxEntries == 1 and CrossUp(v5,v6) or CrossUp(v7,v8) Then
BuY("b2");
if MarketPosition == 1 and MaxEntries == 2 and CrossUp(v9,v10) or CrossUp(v11,v12) Then
buy("b3");
if MarketPosition >= 0 and CrossDown(v1,v2) or CrossDown(v3,v4) Then
Sell("s1");
if MarketPosition == -1 and MaxEntries == 1 and CrossDown(v5,v6) or CrossDown(v7,v8) Then
Sell("s2");
if MarketPosition == -1 and MaxEntries == 2 and CrossDown(v9,v10) or CrossDown(v11,v12) Then
Sell("s3");
2021-03-03
705
글번호 146743
시스템
답변완료
청산식 설명좀 부탁합니다
안녕하세요 아래는 제가 쓰는 매수청산식중에 하나인데요
얼마전에 "익일 3시15분이후까지 청산이 안되면 그이후 강제청산"식을 추가해 달라고했더니
if sDate > EntryDate and sTime >= 151500 Then
ExitLong("bx");
이렇게 넣어주셨더라고요
혹시 식 설명좀 부탁드려도될까요?
왜 저식이 매수당일이 아닌 익일 3시 15분까지 청산이 안되면 강제청산이 되는 식인지요
if MarketPosition == 0 and 진입조건 Then
{
Buy("A1.3");
#진입과 동시에 셋팅되서 진입봉 다음봉만 익절/손절감시해 신호 발생
ExitLong("A1.3.11",AtLimit,C*1.16,"A1.3");
ExitLong("A1.3.31",AtStop,C*0.99,"A1.3");
}
if MarketPosition == 1 Then
{
#A1.3진입
if CurrentContrActs > CurrentContrActs[1] And LAtestEntryNAme(0) == "A1.3" Then
{
A1.3Price = LAtestEntryPrice(0);
A1.3high = H;
}
if A1.3high > 0 And H > A1.3high Then
A1.3high = H;
if A1.3Price > 0 Then
{
ExitLong("A1.3.1",AtLimit,A1.3Price*1.16,"A1.3");
if A1.3high >= A1.3Price*1.01 Then
ExitLong("A1.3.2",AtStop,A1.3high*0.93,"A1.3");
ExitLong("A1.3.3",AtStop,A1.3Price*0.99,"A1.3");
}
if sDate > EntryDate and sTime >= 151500 Then
ExitLong("bx");
}
2021-03-03
672
글번호 146742
시스템
답변완료
시그널메이커를 예스로요~
안녕하세요?
시그널메이커에서 예스로 이사중입니다.꼭좀 변환 부탁드립니다.^^
input : Exit_PT(200),Exit_LPT(200),BuyProfit(150),SellProfit(150),StopTick(100);
var :SP(0);
Params : TradingStartTime1(090000),TradingEndTime1(045400);
var : Today_P( 0 ), Pre_NetProfit( 0 ), ProfitPoint( 0 ),LossPoint(0), myOpenProfit(0),TickPoint(0);
Params : FastPeriod(92), SlowPeriod(109), SignalPeriod(85);
SP = SignalPosition;
TickPoint = OneTick * PriceScale;
V0 = MACD(C, FastPeriod, SlowPeriod);
V1 = XAverage(V0, SignalPeriod);
if Time = 090000 Or (Time >= 090000 And (Time[1] < 090000 Or Date<>date[1])) Then
Begin
ProfitPoint = 0;
Today_P = 0;
Pre_NetProfit = NetProfit[1];
condition99 = false;
condition88 = false;
End;
Today_P = NetProfit - Pre_NetProfit; // 하루 누적 수익
myOpenProfit = OpenPositionProfit;
If (Today_P + myOpenProfit) >= (Exit_PT * TickPoint ) Then
condition99 = true;
If (Today_P + myOpenProfit) <= (-Exit_LPT * TickPoint) Then
condition88 = true;
if TradingStartTime1 < TradingEndTime1 Then
Begin
If TradingStartTIME1 <= TIME And TIME <= TradingEndTIME1 Then COND44 = True
Else COND44 = False;
End
Else
Begin
If TradingStartTIME1 <= TIME Or TIME <= TradingEndTIME1 Then COND44 = True
Else COND44 = False;
End;
If Cond44 = False Then
Begin
if SP <> 0 Then
Begin
ExitLong("마감 매수 청산",OnClose,def,def,CurrentContracts);
ExitShort("마감 매도 청산",OnClose,def,def,CurrentContracts);
End;
Cond44 = False;
End;
ProfitPoint = Exit_PT * TickPoint? - Today_P - myOpenProfit;
LossPoint = Exit_LPT * TickPoint + Today_P + myOpenProfit;
if 1 = Sp then
Begin
ExitLong("매수 익절마감", Atlimit, close + ProfitPoint);
ExitLong("매수 손절마감", AtStop, close - LossPoint);
ExitLong("매수 청산", Atlimit, EntryPrice + BuyProfit * TickPoint );
End
Else if -1 = Sp then
Begin
ExitShort("매도 익절마감", Atlimit, close - ProfitPoint);
ExitShort("매도 손절마감", AtStop, close + LossPoint);
ExitShort("매도 청산", Atlimit, EntryPrice - SellProfit * TickPoint );
End;
//지정한 시간대에만 거래
if Cond44 And false = condition99 And false = condition88 Then
Begin
if CrossUp(V0,V1) Then
Buy("매수")
Else if CrossDown(V0,V1) Then
Sell("매도");
End;
SetStopLoss(StopTick * TickPoint * currentcontracts ,pointstop);
//Trailing 적용하기
Params : up_price1(135), dn_price1(100), up_price2(100), dn_price2(80),up_price3(50), dn_price3(1);
var : TickSize(0);
TickSize = OneTick * PriceScale;
If MaxContractProfit < TickSize * (up_price1 + 10) Then SetStopTrailing(TickSize * dn_price1, TickSize * up_price1)
Else if MaxContractProfit < TickSize * (up_price2 + 10) Then setstopTrailing(TickSize * dn_price2, TickSize * up_price2)
Else SetStopTrailing(TickSize * dn_price3, TickSize * up_price3);
2021-03-02
743
글번호 146740
시스템
답변완료
차트에서 고점과 저점을 저장해서 그때의 시점과 가격을 알고싶습니다.
아래 그림에표시한거처럼 순간순간의 고점과 저점을 배열에 저장하고 이를 매매에 사용하고싶은데 어떻게 하면좋을지 수식작성부탁드립니다.
이런식으로 저장해볼라고했는데 저장은 할수있어도 이를 매매에 사용하기가 어렵더라고요..
혜안 부탁드립니다.
var : triger(0),lasthigh(0),lasthightime(0),lastlow(0),lastlowtime(0),bong(0);
array : everhigh[100](0),everhightime[100](0),everlow[100](0),everlowtime[100](0);
lasthigh = H;
lasthightime = time;
lastlow = L;
lastlowtime = time;
for bong = 1 to 100
{
if lasthigh < H[bong] then
{
lasthigh = H[bong];
lasthightime = time[bong];
everhigh[bong] = H[bong];
everhightime[bong] = time[bong];
}
if lastlow > L[bong] then
{
lastlow = L[bong];
lastlowtime = time[bong];
everlow[bong] = L[bong];
everlowtime[bong] = time[bong];
}
if bong > 6 and everhightime[bong] == 0 and everhightime[bong-1] == 0 and everhightime[bong-2] == 0 and everhightime[bong-3] == 0 and everhightime[bong-4] == 0 and everhightime[bong-5] == 0 then
{
lastlow = L[bong];
}
if bong > 6 and everlowtime[bong] == 0 and everlowtime[bong-1] == 0 and everlowtime[bong-2] == 0 and everlowtime[bong-3] == 0 and everlowtime[bong-4] == 0 and everlowtime[bong-5] == 0 then
{
lasthigh = H[bong];
}
}
2021-03-01
868
글번호 146713
시스템
답변완료
문의 드립니다.
안녕하세요 항상 도움을 주시는 노고에 감사드립니다.
트레이딩뷰에서 본 차트인데.. 공개되어 있는데 수식인것 같구요..
이것을 혹여 예스 수식으로 변환이 가능할런지요???
캡쳐해서 수식적용한 화면도 같이 남겨놓겠습니다.
아래는 수식인것 같아요..
도움좀 부탁드립니다. 감사합니다.
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © CryptoComrade
//@version=4
avg_candle(n)=> sma(abs(high - low), n)
is_support(c, level)=> c > level
prox_check(x, up_levels, down_levels, multiplier)=>abs(x - array.get(up_levels, 0)) > multiplier * avg_candle(100) and abs(x - array.get(down_levels, 0)) > multiplier * avg_candle(100)
study("Median CrossOver Levels", overlay=true)
n = input(100)
prox_mult = input(2.5)
var float[] cross_up_points = array.new_float(3, 0.0)
var float[] cross_dn_points = array.new_float(3, 0.0)
// Check if price has closed above median.
med = percentile_nearest_rank(high, n, 50)
above_med = close > med
// Crossed over median.
cross_above = not above_med[1] and above_med
// Crossed below median.
cross_below = above_med[1] and not above_med
if cross_above and prox_check(low, cross_up_points, cross_dn_points, prox_mult)
array.unshift(cross_up_points, low)
if cross_below and prox_check(high, cross_up_points, cross_dn_points, prox_mult)
array.unshift(cross_dn_points, high)
barcolor(close > med ? color.green : color.red)
plot(array.get(cross_up_points, 0), color=is_support(close, array.get(cross_up_points, 0)) ? color.green : color.red, linewidth=2, style=plot.style_cross, transp=0)
plot(array.get(cross_dn_points, 0), color=is_support(close, array.get(cross_dn_points, 0)) ? color.green : color.red, linewidth=2, style=plot.style_cross, transp=0)
plot(array.get(cross_up_points, 1), color=is_support(close, array.get(cross_up_points, 1)) ? color.green : color.red, style=plot.style_cross, transp=0)
plot(array.get(cross_dn_points, 1), color=is_support(close, array.get(cross_dn_points, 1)) ? color.green : color.red, style=plot.style_cross, transp=0)
2021-03-01
853
글번호 146711
지표