예스스탁
예스스탁 답변
2022-05-27 15:31:58
안녕하세요
예스스탁입니다.
Input : shortPeriod(5), longPeriod(20);
Value1 = ma(C, shortPeriod);
value2 = ma(C, longPeriod);
If MarketPosition <= 0 and CrossUP(value1, value2) Then
{
Buy("b1",OnClose,Def,2);
Buy("b2.",AtLimit,c-PriceScale*2,2);
Buy("b3.",AtLimit,c-PriceScale*6,2);
ExitLong("bl.",AtStop,C-PriceScale*10);
}
If MarketPosition >= 0 and CrossDown(value1, value2) Then
{
Sell("s1",OnClose,Def,2);
Sell("s2.",AtLimit,c+PriceScale*2,2);
Sell("s3.",AtLimit,c+PriceScale*6,2);
ExitShort("SL,",AtStop,C+PriceScale*10);
}
if MarketPosition == 1 Then
{
if lowest(L,BarsSinceEntry) > EntryPrice-PriceScale*2 Then
Buy("b2",AtLimit,EntryPrice-PriceScale*2);
if lowest(L,BarsSinceEntry) > EntryPrice-PriceScale*6 Then
Buy("b3",AtLimit,EntryPrice-PriceScale*6);
ExitLong("bl",AtStop,EntryPrice-PriceScale*10);
ExitLong("bp1",AtLimit,avgEntryPrice+PriceScale*5,"b1");
ExitLong("bp2",AtLimit,avgEntryPrice+PriceScale*7);
if CurrentContracts < MaxContracts Then
ExitLong("bx",AtStop,AvgEntryPrice);
}
if MarketPosition == -1 Then
{
if highest(L,BarsSinceEntry) < EntryPrice+PriceScale*2 Then
Sell("s2",AtLimit,EntryPrice+PriceScale*2);
if highest(L,BarsSinceEntry) < EntryPrice+PriceScale*6 Then
Sell("s3",AtLimit,EntryPrice+PriceScale*6);
ExitShort("sl",AtStop,EntryPrice+PriceScale*10);
ExitShort("sp1",AtLimit,avgEntryPrice-PriceScale*5,"s1");
ExitShort("sp2",AtLimit,avgEntryPrice-PriceScale*7);
if CurrentContracts < MaxContracts Then
ExitShort("sx",AtStop,AvgEntryPrice);
}
즐거운 하루되세요
> thdgus1s 님이 쓴 글입니다.
> 제목 : 감사합니다~^^ 추가문의드립니다
> 수식 [77400] 작성해주셔서 감사합니다^^
아래수식에도 [77400번]과 똑 같이 적용해서 한번더 부탁드립니다
Input : shortPeriod(5), longPeriod(20);
Value1 = ma(C, svahortPeriod);
value2 = ma(C, longPeriod);
# 매수/매도청산
if Value1 > Value2 then
{
buy ("매수")
}
# 매도/매수청산
if Value1 < Value2 then
{
sell ("매도")
}