커뮤니티
잘못된 토큰 :then
2015-03-09 00:38:45
155
글번호 83812
저번에 포지션이 5틱 깎이면 청산하고, 그뒤로 또 5틱이 내려가면 반대포지션으로 진입하면서 사이즈를 2배로 키우는 수식을 부탁해서
var : buyvol(0),Sellvol(0);
if MarketPosition == 1 Then{
buyvol = MaxContracts;
exitlong("매수청산",AtStop,EntryPrice-PriceScale*5);
}
if MarketPosition == 0 and MarketPosition(1) == 1 Then
sell("매도로전환",AtStop,EntryPrice(1)-PriceScale*10);
if MarketPosition == -1 Then{
Sellvol = MaxContracts;
ExitShort("매도청산",AtStop,EntryPrice+PriceScale*5);
}
if MarketPosition == 0 and MarketPosition(1) == -1 Then
Buy("매수로전환",AtStop,EntryPrice(1)+PriceScale*10);
이런 답변을 받았는데요 일단 저기 2배로 키우는 조건이 안붙어서
var : buyvol(0),Sellvol(0);
if MarketPosition == 1 Then{
buyvol = MaxContracts;
exitlong("매수청산",AtStop,EntryPrice-PriceScale*5);
}
if MarketPosition == 0 and MarketPosition(1) == 1 Then
sell("매도로전환",AtStop,EntryPrice(1)-PriceScale*10,buyvol*2);
if MarketPosition == -1 Then{
Sellvol = MaxContracts;
ExitShort("매도청산",AtStop,EntryPrice+PriceScale*5);
}
if MarketPosition == 0 and MarketPosition(1) == -1 Then
Buy("매수로전환",AtStop,EntryPrice(1)+PriceScale*10,sellvol*2);
이렇게 변경해서 적용해봤는데
변경하기 전이나 후나 잘못된 토큰 'then' 이라고 에러가 나네요 ㅠㅠ
뭐가 잘못된거죠?
if MarketPosition == 0 and MarketPosition(1) == 1 Then
sell("매도로전환",AtStop,EntryPrice(1)-PriceScale*10,buyvol*2);
여기서 then이 에러가 난거같은데..
답변 1
예스스탁 예스스탁 답변
2015-03-09 13:57:47
안녕하세요
예스스탁입니다.
올려주신 식 첨부된 그림과 같이
모두 해당 오류가 나오지 않고 정상 검증됩니다.
해당식 외에 다른 부분에서 오류가 나는것 같습니다.
즐거운 하루되세요
> ysp2101 님이 쓴 글입니다.
> 제목 : 잘못된 토큰 :then
> 저번에 포지션이 5틱 깎이면 청산하고, 그뒤로 또 5틱이 내려가면 반대포지션으로 진입하면서 사이즈를 2배로 키우는 수식을 부탁해서
var : buyvol(0),Sellvol(0);
if MarketPosition == 1 Then{
buyvol = MaxContracts;
exitlong("매수청산",AtStop,EntryPrice-PriceScale*5);
}
if MarketPosition == 0 and MarketPosition(1) == 1 Then
sell("매도로전환",AtStop,EntryPrice(1)-PriceScale*10);
if MarketPosition == -1 Then{
Sellvol = MaxContracts;
ExitShort("매도청산",AtStop,EntryPrice+PriceScale*5);
}
if MarketPosition == 0 and MarketPosition(1) == -1 Then
Buy("매수로전환",AtStop,EntryPrice(1)+PriceScale*10);
이런 답변을 받았는데요 일단 저기 2배로 키우는 조건이 안붙어서
var : buyvol(0),Sellvol(0);
if MarketPosition == 1 Then{
buyvol = MaxContracts;
exitlong("매수청산",AtStop,EntryPrice-PriceScale*5);
}
if MarketPosition == 0 and MarketPosition(1) == 1 Then
sell("매도로전환",AtStop,EntryPrice(1)-PriceScale*10,buyvol*2);
if MarketPosition == -1 Then{
Sellvol = MaxContracts;
ExitShort("매도청산",AtStop,EntryPrice+PriceScale*5);
}
if MarketPosition == 0 and MarketPosition(1) == -1 Then
Buy("매수로전환",AtStop,EntryPrice(1)+PriceScale*10,sellvol*2);
이렇게 변경해서 적용해봤는데
변경하기 전이나 후나 잘못된 토큰 'then' 이라고 에러가 나네요 ㅠㅠ
뭐가 잘못된거죠?
if MarketPosition == 0 and MarketPosition(1) == 1 Then
sell("매도로전환",AtStop,EntryPrice(1)-PriceScale*10,buyvol*2);
여기서 then이 에러가 난거같은데..
다음글
이전글