커뮤니티
수정부탁드립니다.
2015-06-16 11:58:58
109
글번호 87252
아래 첫번째 지표식과 두번째 시스템식의 결과가 같도록 지표식을 수정부탁드립니다.
=======================================================
Input : 수량(1),봉갯수(10);
Var : MP(0),BuySellEntryPrice(0),OpenPP(0),NP(0);
var : Hst(0),Lst(0);
// Hst = Highest(H,봉갯수);
// Lst = Lowest(L,봉갯수);
If MP == 1 Then{
OpenPP = (C-BuySellEntryPrice)*수량;
}
Else If MP == -1 Then {
OpenPP = (BuySellEntryPrice-C)*수량;
}
Else {
OpenPP == 0;
}
If MP <= 0 and Highest(H,봉갯수)[1] < H Then{
//If Highest(H,봉갯수)[1] < H Then{
if MP == -1 Then{
NP = NP+OpenPP*수량;
}
BuySellEntryPrice = C;
MP = 1;
}
If MP >= 0 and Lowest(L,봉갯수)[1] > L Then{
//If Lowest(L,봉갯수)[1] > L Then{
if MP == 1 Then{
NP = NP+OpenPP*수량;
}
BuySellEntryPrice = C;
MP = -1;
}
//plot1(OpenPP);
//plot2(NP);
MessageLog("시가,%.4f,종가,%.4f,MP,%.0f,NP,%.4f,OpenPP,%.4f",open,close,MP,NP,OpenPP);
======================================================================
Input: 봉갯수(10);
If MarketPosition == 0 Then
{
If Highest(H,봉갯수)[1] < H Then
{
Buy();
}
If Lowest(L,봉갯수)[1] > L Then
{
Sell();
}
}
If MarketPosition > 0 Then
{
If Lowest(L,봉갯수)[1] > L Then Sell();
}
Else If MarketPosition < 0 Then
{
If Highest(H,봉갯수)[1] < H Then Buy();
}
답변 1
예스스탁 예스스탁 답변
2015-06-16 18:42:42
안녕하세요
예스스탁입니다.
매수와 매도조건이 동시충족되는 봉이 있습니다.
시스템은 내부적으로 반대신호만 잡지만
지표식에서는 순서대로 진행하므로 동일봉에서 값이 두번 계산됩니다.
인덱스로 구분시켜 매도와 매수가 같은봉에서 동시 계산되지 않게 했습니다.
Input : 수량(1),봉갯수(10);
Var : MP(0),BuySellEntryPrice(0),OpenPP(0),NP(0);
var : Hst(0),Lst(0),idx(0);
// Hst = Highest(H,봉갯수);
// Lst = Lowest(L,봉갯수);
If MP == 1 Then{
OpenPP = (C-BuySellEntryPrice)*수량;
}
If MP == -1 Then {
OpenPP = (BuySellEntryPrice-C)*수량;
}
Else{
OpenPP == 0;
}
If MP <= 0 and Highest(H,봉갯수)[1] < H and index > idx Then{
idx = index;
if MP == -1 Then{
NP = NP+OpenPP;
}
BuySellEntryPrice = C;
MP = 1;
}
If MP >= 0 and Lowest(L,봉갯수)[1] > L and index > idx Then{
idx = index;
if MP == 1 Then{
NP = NP+OpenPP;
}
BuySellEntryPrice = C;
MP = -1;
}
plot1(OpenPP);
plot2(NP);
MessageLog("시가,%.4f,종가,%.4f,MP,%.0f,NP,%.4f,OpenPP,%.4f",open,close,MP,NP,OpenPP);
즐거운 하루되세요
> 9단 님이 쓴 글입니다.
> 제목 : 수정부탁드립니다.
> 아래 첫번째 지표식과 두번째 시스템식의 결과가 같도록 지표식을 수정부탁드립니다.
=======================================================
Input : 수량(1),봉갯수(10);
Var : MP(0),BuySellEntryPrice(0),OpenPP(0),NP(0);
var : Hst(0),Lst(0);
// Hst = Highest(H,봉갯수);
// Lst = Lowest(L,봉갯수);
If MP == 1 Then{
OpenPP = (C-BuySellEntryPrice)*수량;
}
Else If MP == -1 Then {
OpenPP = (BuySellEntryPrice-C)*수량;
}
Else {
OpenPP == 0;
}
If MP <= 0 and Highest(H,봉갯수)[1] < H Then{
//If Highest(H,봉갯수)[1] < H Then{
if MP == -1 Then{
NP = NP+OpenPP*수량;
}
BuySellEntryPrice = C;
MP = 1;
}
If MP >= 0 and Lowest(L,봉갯수)[1] > L Then{
//If Lowest(L,봉갯수)[1] > L Then{
if MP == 1 Then{
NP = NP+OpenPP*수량;
}
BuySellEntryPrice = C;
MP = -1;
}
//plot1(OpenPP);
//plot2(NP);
MessageLog("시가,%.4f,종가,%.4f,MP,%.0f,NP,%.4f,OpenPP,%.4f",open,close,MP,NP,OpenPP);
======================================================================
Input: 봉갯수(10);
If MarketPosition == 0 Then
{
If Highest(H,봉갯수)[1] < H Then
{
Buy();
}
If Lowest(L,봉갯수)[1] > L Then
{
Sell();
}
}
If MarketPosition > 0 Then
{
If Lowest(L,봉갯수)[1] > L Then Sell();
}
Else If MarketPosition < 0 Then
{
If Highest(H,봉갯수)[1] < H Then Buy();
}
이전글