커뮤니티
문의 드립니다.
2013-01-30 21:16:30
189
글번호 58904
가령,
Input : shortPeriod(5), longPeriod(10),shortPeriod1(20), longPeriod1(40),;;
value1 = ma(C, shortPeriod);
value2 = ma(C, longPeriod);
value3 = ma(C, shortPeriod1);
value4 = ma(C, longPeriod1);
if 3 < 0 then
---------------
If CrossUP(value1, value2) Then
{
Buy();
}
If CrossDown(value1, value2) Then
{
Sell();
}
if 3 > 0 then
----------------
If CrossUP(value3, value4) Then
{
Buy();
}
If CrossDown(value3, value4) Then
{
Sell();
}
(----------)
여기 잘못된거 같아요.
수정 해주세요.
감사합니다.
답변 1
예스스탁 예스스탁 답변
2013-01-31 10:28:33
안녕하세요
예스스탁입니다.
특정if문안에 여러개의 if문이 포함될때는 {}로 묶어주셔야 합니다.
Input : shortPeriod(5), longPeriod(10),shortPeriod1(20), longPeriod1(40);
value1 = ma(C, shortPeriod);
value2 = ma(C, longPeriod);
value3 = ma(C, shortPeriod1);
value4 = ma(C, longPeriod1);
if 3 < 0 then{
If CrossUP(value1, value2) Then
{
Buy();
}
If CrossDown(value1, value2) Then
{
Sell();
}
}
if 3 > 0 then {
If CrossUP(value3, value4) Then
{
Buy();
}
If CrossDown(value3, value4) Then
{
Sell();
}
}
즐거운 하루되세요
> 줄리 님이 쓴 글입니다.
> 제목 : 문의 드립니다.
> 가령,
Input : shortPeriod(5), longPeriod(10),shortPeriod1(20), longPeriod1(40),;;
value1 = ma(C, shortPeriod);
value2 = ma(C, longPeriod);
value3 = ma(C, shortPeriod1);
value4 = ma(C, longPeriod1);
if 3 < 0 then
---------------
If CrossUP(value1, value2) Then
{
Buy();
}
If CrossDown(value1, value2) Then
{
Sell();
}
if 3 > 0 then
----------------
If CrossUP(value3, value4) Then
{
Buy();
}
If CrossDown(value3, value4) Then
{
Sell();
}
(----------)
여기 잘못된거 같아요.
수정 해주세요.
감사합니다.