Trying to create a new databank column and need help
2件の返信
I attempted to create a databank indicator, it compiled, but then I was locked out of the system after I exited SQX and went back in because when compiling snippets there was some type of dependency problem – very frustrating. Can you tell me what I need to do to correct this code?
AvgWnAvgLs
******************
`
パッケージ SQ.Columns.Databanks;
com.strategyquant.lib.*; をインポートする;
import com.strategyquant.datalib.*;
import com.strategyquant.tradinglib.*;
public class AvgWnAvgLs extends DatabankColumn {
public AvgWnAvgLs() {
super(“AvgWn/AvgLs”,
DatabankColumn.Decimal2, // 値の表示形式
ValueTypes.Maximize: 値を最大化/最小化/近似値にすることの有無
0, //近似が選択された場合の値
0, // この値の平均最小値
100); // この値の平均最大値
setWidth(80); // デフォルトの列幅はピクセル単位
setTooltip(“Avg. Win / Avg. Loss”);
setDependencies(“Avg. Win”, “Avg. Loss”);
}
@Override
public double compute(SQStats stats, StatsTypeCombination combination, OrdersList ordersList, SettingsMap settings, SQStats statsLong, SQStats statsShort) throws Exception {
double avgwn = stats.getDouble(“Avg. Win”);
double avgls = stats.getDouble(“Avg. Loss”);
double avgwn_avgls = SQUtils.safeDivide(avgwn, avgls);
/* round and return the value. It will be saved into stats under the key “AvgWn2AvgLs” */
return round2(avgwn_avgls);
}
}
トム・C
0
こんにちは,
the problem is you are referering incorrectly to certain stats such as setDependencies(“Avg. Win”, “Avg. Loss”);
It should be correctly referred as “AvgLoss” or “AvgWin”
1
Thank you Tomas. Is there a reference or place where I can see the variable names of all of these columns?
ありがとう、,
トム・C
トム・C
0
2件の返信を表示中 - 1 - 2件目 (全2件中)