예스스탁
예스스탁 답변
2021-11-09 14:53:27
안녕하세요
예스스탁입니다.
if Tcond == true Then
{
if MarketPosition == 0 and OO > 0 and LL > OO-PriceScale*진입틱수 Then
Buy("하루시작매수",AtStop,LL+PriceScale*진입틱수);
if MarketPosition == 0 and OO > 0 and HH < OO+PriceScale*진입틱수 Then
Sell("하루시작매도",AtStop,HH-PriceScale*진입틱수);
}
if MarketPosition == 1 Then
{
if Tcond == true Then
Sell("Bl1",AtStop,EntryPrice-PriceScale*진입틱수);
Else
Exitlong("Bl2",AtLimit,EntryPrice-PriceScale*진입틱수);
if highest(H,BarsSinceEntry) >= EntryPrice+PriceScale*최소손실틱 Then
{
if Tcond == true Then
Sell("sx1",AtLimit,highest(H,BarsSinceEntry)-PriceScale*손실감소틱);
Else
ExitLong("sx2",AtLimit,highest(H,BarsSinceEntry)-PriceScale*손실감소틱);
}
}
if MarketPosition == -1 Then
{
if Tcond == true Then
Buy("sl1",AtStop,EntryPrice+PriceScale*진입틱수);
Else
ExitShort("sl2",AtStop,EntryPrice+PriceScale*진입틱수);
if lowest(L,BarsSinceEntry) <= EntryPrice-PriceScale*최소손실틱 Then
{
if Tcond == true Then
Buy("bx1",AtStop,lowest(L,BarsSinceEntry)+PriceScale*손실감소틱);
Else
ExitShort("bx2",AtLimit,Lowest(L,BarsSinceEntry)+PriceScale*손실감소틱);
}
}
즐거운 하루되세요
> 예스요 님이 쓴 글입니다.
> 제목 : 문의 드립니다.~~~~
> 아래 식은 역추세 진입 역추세 청산 재진입식입니다.
이 식을 반대로
1,추세 진입
2,추세 청산과 동시에 추세 재진입식으로
바꾸어 보려고 하는데 잘 되지 않아
도움을 요청합니다.
if Tcond == true Then
{
if MarketPosition == 0 and OO > 0 and LL > OO-PriceScale*진입틱수 Then
Sell("하루시작매도",AtLimit,LL+PriceScale*진입틱수);
if MarketPosition == 0 and OO > 0 and HH < OO+PriceScale*진입틱수 Then
Buy("하루시작메수",AtLimit,HH-PriceScale*진입틱수);
}
if MarketPosition == 1 Then
{
if Tcond == true Then
Sell("Bp1",AtLimit,EntryPrice+PriceScale*진입틱수);
Else
ExitLong("Bp2",AtLimit,EntryPrice+PriceScale*진입틱수);
if Lowest(L,BarsSinceEntry) <= EntryPrice-PriceScale*최소손실틱 Then
{
if Tcond == true Then
Sell("sx1",AtLimit,Lowest(L,BarsSinceEntry)+PriceScale*손실감소틱);
Else
ExitLong("sx2",AtLimit,Lowest(L,BarsSinceEntry)+PriceScale*손실감소틱);
}
}
if MarketPosition == -1 Then
{
if Tcond == true Then
Buy("sp1",AtLimit,EntryPrice-PriceScale*진입틱수);
Else
ExitShort("sp2",AtLimit,EntryPrice-PriceScale*진입틱수);
if highest(H,BarsSinceEntry) >= EntryPrice+PriceScale*최소손실틱 Then
{
if Tcond == true Then
Buy("bx1",AtLimit,highest(H,BarsSinceEntry)-PriceScale*손실감소틱);
Else
ExitShort("bx2",AtLimit,highest(H,BarsSinceEntry)-PriceScale*손실감소틱);
}
}