아래 식의 경우, 매수시간대를 나눠놓기는 했지만
이전진입가의 n배수를 설정할때, n1 n2를 어떻게 설정하느냐에 따라서
의도와는 달리 하루에 두번을 매수하게되는 경우가 생깁니다 ㅠ
하루에 이미 한번 매수했으면 더는 매수안하게 하는 수식을 추가할 수 있을까요...?
if MarketPosition == 1 Then
{
if CurrentContracts > CurrentContracts[1] Then
{
ex_money = LatestEntryPrice(0)*(CurrentContracts-CurrentContracts[1]);
}
if stime >= 090100 and Stime < 151000 Then
Buy("피라미딩1", AtStop,LatestEntryPrice(0)* n2 , 수량 );
if stime >= 151000 and Stime < 151900 Then
Buy("피라미딩2", AtStop,LatestEntryPrice(0)* n1 , 수량 ) ;
}
답변 1
예스스탁
예스스탁 답변
2023-05-03 13:54:59
안녕하세요
예스스탁입니다.
var : add1(False),add2(False);
if Bdate != Bdate[1] Then
{
add1 = true;
add1 = true;
}
if MarketPosition == 1 Then
{
if CurrentContracts > CurrentContracts[1] Then
{
ex_money = LatestEntryPrice(0)*(CurrentContracts-CurrentContracts[1]);
if LatestEntryName(0) == "피라미딩1" Then
Add1 = False;
if LatestEntryName(0) == "피라미딩2" Then
Add2 = False;
}
if stime >= 090100 and Stime < 151000 and Add1 == true Then
Buy("피라미딩1", AtStop,LatestEntryPrice(0)* n2 , 수량 );
if stime >= 151000 and Stime < 151900 and Add2 == true Then
Buy("피라미딩2", AtStop,LatestEntryPrice(0)* n1 , 수량 ) ;
}
즐거운 하루되세요
> 루라라라 님이 쓴 글입니다.
> 제목 : 문의드립니다
> 아래 식의 경우, 매수시간대를 나눠놓기는 했지만
이전진입가의 n배수를 설정할때, n1 n2를 어떻게 설정하느냐에 따라서
의도와는 달리 하루에 두번을 매수하게되는 경우가 생깁니다 ㅠ
하루에 이미 한번 매수했으면 더는 매수안하게 하는 수식을 추가할 수 있을까요...?
if MarketPosition == 1 Then
{
if CurrentContracts > CurrentContracts[1] Then
{
ex_money = LatestEntryPrice(0)*(CurrentContracts-CurrentContracts[1]);
}
if stime >= 090100 and Stime < 151000 Then
Buy("피라미딩1", AtStop,LatestEntryPrice(0)* n2 , 수량 );
if stime >= 151000 and Stime < 151900 Then
Buy("피라미딩2", AtStop,LatestEntryPrice(0)* n1 , 수량 ) ;
}