예스스탁
예스스탁 답변
2023-12-08 10:55:21
안녕하세요
예스스탁입니다.
지정하신 손절과 트레일링스탑 값이 틱수인지 포인트인지 불명확합니다.
포인트이면 1번, 틱수이면 2번식 이용하시면 됩니다.
1
input : 상승2(5),상승3(10);
input : 수2(41),수3(37);
input : 상승22(15),상승33(20);
input : 수22(41),수33(37);
input: 손절1(170),최소만족트레스탑1(250),트레스탑1(340);
input: 손절2(150),최소만족트레스탑2(230),트레스탑2(320);
if MarketPosition == 1 Then
{
if IsEntryName("b1") == true Then
{
if MaxEntries == 1 Then
Buy("b2",AtStop,LatestEntryPrice(0)+상승2,수2);
if MaxEntries == 2 Then
Buy("b3",AtStop,LatestEntryPrice(0)+상승3,수3);
SetStopLoss(손절1,PointStop);
SetStopTrailing(트레스탑1,최소만족트레스탑1,PointStop);
}
Else if IsEntryName("bb1") == true Then
{
if MaxEntries == 1 Then
Buy("bb2",AtStop,LatestEntryPrice(0)+상승22,수22);
if MaxEntries == 2 Then
Buy("bb3",AtStop,LatestEntryPrice(0)+상승33,수33);
SetStopLoss(손절2,PointStop);
SetStopTrailing(트레스탑2,최소만족트레스탑2,PointStop);
}
Else
{
SetStopLoss(0);
SetStopTrailing(0,0);
}
}
Else
{
SetStopLoss(0);
SetStopTrailing(0,0);
}
2
input : 상승2(5),상승3(10);
input : 수2(41),수3(37);
input : 상승22(15),상승33(20);
input : 수22(41),수33(37);
input: 손절1(170),최소만족트레스탑1(250),트레스탑1(340);
input: 손절2(150),최소만족트레스탑2(230),트레스탑2(320);
if MarketPosition == 1 Then
{
if IsEntryName("b1") == true Then
{
if MaxEntries == 1 Then
Buy("b2",AtStop,LatestEntryPrice(0)+상승2,수2);
if MaxEntries == 2 Then
Buy("b3",AtStop,LatestEntryPrice(0)+상승3,수3);
SetStopLoss(손절1*PriceScale,PointStop);
SetStopTrailing(트레스탑1*PriceScale,최소만족트레스탑1*PriceScale,PointStop);
}
Else if IsEntryName("bb1") == true Then
{
if MaxEntries == 1 Then
Buy("bb2",AtStop,LatestEntryPrice(0)+상승22,수22);
if MaxEntries == 2 Then
Buy("bb3",AtStop,LatestEntryPrice(0)+상승33,수33);
SetStopLoss(손절2*PriceScale,PointStop);
SetStopTrailing(트레스탑2*PriceScale,최소만족트레스탑2*PriceScale,PointStop);
}
Else
{
SetStopLoss(0);
SetStopTrailing(0,0);
}
}
Else
{
SetStopLoss(0);
SetStopTrailing(0,0);
}
즐거운 하루되세요
> 목마와숙녀 님이 쓴 글입니다.
> 제목 : 문의
> 최초 진입시 피라미딩된 그룹a(b1,b2,b3)
추후 재진입하여 피라미딩된 그룹b(bb1,bb2,bb3)
두 그룹에 각각 다른 손절,트레일링스탑을 적용하는 수식을 작성해주셨으면 합니다.
항상 고맙습니다.
************************************************************************
input : 상승2(5),상승3(10);
input : 수2(41),수3(37);
input : 상승22(15),상승33(20);
input : 수22(41),수33(37);
최초 b1 진입
input: 손절1(170),최소만족트레스탑1(250),트레스탑1(340);
if MarketPosition == 1 and IsEntryName("b1") == true Then
{
if MaxEntries == 1 Then
Buy("b2",AtStop,LatestEntryPrice(0)+상승2,수2);
if MaxEntries == 2 Then
Buy("b3",AtStop,LatestEntryPrice(0)+상승3,수3);
}
포지션 없다가 고점갱신시 bb1 진입
input: 손절2(150),최소만족트레스탑2(230),트레스탑2(320);
if MarketPosition == 1 and IsEntryName("bb1") == true Then
{
if MaxEntries == 1 Then
Buy("bb2",AtStop,LatestEntryPrice(0)+상승22,수22);
if MaxEntries == 2 Then
Buy("bb3",AtStop,LatestEntryPrice(0)+상승33,수33);
}