커뮤니티
부탁드립니다.
2015-12-21 11:05:21
120
글번호 93624
그림과같이 청산되는 봉에서 청산이 되어도 신호의 유지가 되면
다시 신호가 발생이 되는데...청산봉에서 신호가 발생되지 않도록 부탁드립니다.
( 다음신호 기다리게 부탁드립니다.)
( 다른신호만 허용하는 피라미딩 사용중)
매수식입니다.
If MarketPosition <= 0 and
T1 == 1 and T2 == 1 and i1 < i2 and
T3 == 1 and T4 == 1 Then
{
Buy("b");
}
If MarketPosition == 1 and MaxEntries == 1 and
CountIF(T1 == -1,BarsSinceEntry) >= 1 and
CountIF(T2 == -1,BarsSinceEntry) >= 1 and
T1 == 1 and T2 == 1 and i1 < i2 and
T3 == 1 and T4 == 1 Then
{
Buy("bb");
}
매수청산식입니다.
if MarketPosition == 1 Then{
exitlong("bl",AtStop,EntryPrice-PriceScale*손절틱수,"b");
exitlong("bp",AtLimit,EntryPrice+PriceScale*익절틱수,"b");
}
if MarketPosition == 1 Then{
exitlong("b2l",AtStop,EntryPrice-PriceScale*손절틱수,"bb");
exitlong("b2p",AtLimit,EntryPrice+PriceScale*익절틱수,"bb");
}
- 1. 예스0320151220_114651.jpg (0.07 MB)
답변 1
예스스탁 예스스탁 답변
2015-12-21 15:18:34
안녕하세요
예스스탁입니다.
진입후 청산해서 무포지션이라 b라는 진입이 또 발생합니다.
청산되면 총거래횟수가 증가하는데
진입식에 TotalTrades == TotalTrades[1] 와 같은 조건을
주어 청산봉에서 진입이 일어나지 않게 하시면 됩니다.
하지만 아래 조건이 계속 유지되면 다음봉에 또 나오게 됩니다.
T1 == 1 and T2 == 1 and i1 < i2 and
T3 == 1 and T4 == 1
위 조건에 각 변수값이 어떤 내용인지 알수없지만
아래와 같이 처리하시면
T1 == 1 and T2 == 1 and i1 < i2 and
T3 == 1 and T4 == 1
조건이 만족하지 않다가 새로 만족한 봉에서 진입하게 됩니다.
해당 부분은 사용자분이 수식에 변수의 저장형태등을 고려하셔서
적당한 방법을 찾으셔야 합니다.
변수값만 보고는 내용을 정확히 컨트롤 할수가 없습니다.
Condition1 = T1 == 1 and T2 == 1 and i1 < i2 and T3 == 1 and T4 == 1;
If MarketPosition <= 0 and
TotalTrades == TotalTrades[1] and
Condition1 == true and Condition1[1] == false then
{
Buy("b");
}
If MarketPosition == 1 and MaxEntries == 1 and
CountIF(T1 == -1,BarsSinceEntry) >= 1 and
CountIF(T2 == -1,BarsSinceEntry) >= 1 and
T1 == 1 and T2 == 1 and i1 < i2 and
T3 == 1 and T4 == 1 Then
{
Buy("bb");
}
if MarketPosition == 1 Then{
exitlong("bl",AtStop,EntryPrice-PriceScale*손절틱수,"b");
exitlong("bp",AtLimit,EntryPrice+PriceScale*익절틱수,"b");
}
if MarketPosition == 1 Then{
exitlong("b2l",AtStop,EntryPrice-PriceScale*손절틱수,"bb");
exitlong("b2p",AtLimit,EntryPrice+PriceScale*익절틱수,"bb");
}
즐거운 하루되세요
> vmfha 님이 쓴 글입니다.
> 제목 : 부탁드립니다.
> 그림과같이 청산되는 봉에서 청산이 되어도 신호의 유지가 되면
다시 신호가 발생이 되는데...청산봉에서 신호가 발생되지 않도록 부탁드립니다.
( 다음신호 기다리게 부탁드립니다.)
( 다른신호만 허용하는 피라미딩 사용중)
매수식입니다.
If MarketPosition <= 0 and
T1 == 1 and T2 == 1 and i1 < i2 and
T3 == 1 and T4 == 1 Then
{
Buy("b");
}
If MarketPosition == 1 and MaxEntries == 1 and
CountIF(T1 == -1,BarsSinceEntry) >= 1 and
CountIF(T2 == -1,BarsSinceEntry) >= 1 and
T1 == 1 and T2 == 1 and i1 < i2 and
T3 == 1 and T4 == 1 Then
{
Buy("bb");
}
매수청산식입니다.
if MarketPosition == 1 Then{
exitlong("bl",AtStop,EntryPrice-PriceScale*손절틱수,"b");
exitlong("bp",AtLimit,EntryPrice+PriceScale*익절틱수,"b");
}
if MarketPosition == 1 Then{
exitlong("b2l",AtStop,EntryPrice-PriceScale*손절틱수,"bb");
exitlong("b2p",AtLimit,EntryPrice+PriceScale*익절틱수,"bb");
}