読み取り専用

フォーラムは現在、読み取り専用のアーカイブとなっています。.

バグ報告やプラットフォームに関する質問はこちら → [email protected]

私たちのコミュニティはDiscordとYouTubeで活動しています。ぜひ参加してください!

ご参加ください Discord YouTube

Change Profitable Month conditions

3件の返信

ラウル・フランケ

Customer, bbp_participant, sq-ultimate, community, 15 replies.

プロフィールを表示

2年前 #284354

Does anyone know how to change the Profitable Month column so that it indicates the months that are >0 instead of >=0?
Or how to make a new Databank column with these conditions?
Thank you so much

0

Tomas Matejka

管理者、sq-ultimate、2件の返信.

プロフィールを表示

2年前 #284386

You can edit the rule using CodeEditor

Alternatively you can edit your own formula – see our tutorial here https://strategyquant.com/doc/programming-for-sq/adding-new-databank-column/

1

ラウル・フランケ

Customer, bbp_participant, sq-ultimate, community, 15 replies.

プロフィールを表示

2年前 #284399

Thank you very much, the problem was that it uses the months traded instead of the total months. I think that with this new column the problem is solved. (but only works for strategies generated after adding and compiling the column)

0

ラウル・フランケ

Customer, bbp_participant, sq-ultimate, community, 15 replies.

プロフィールを表示

2年前 #284400

パッケージ SQ.Columns.Databanks;
import com.strategyquant.lib.L;
import com.strategyquant.lib.SQUtils;
import com.strategyquant.lib.SettingsMap;
import com.strategyquant.tradinglib.DatabankColumn;
import com.strategyquant.tradinglib.OrdersList;
import com.strategyquant.tradinglib.SQStats;
import com.strategyquant.tradinglib.StatsTypeCombination;
import com.strategyquant.tradinglib.ValueTypes;
public class TotalProfitableMonthsPct extends DatabankColumn {
public TotalProfitableMonthsPct() {
super(L.tsq(“% Total Profitable Months”), DatabankColumn.Decimal2Pct, ValueTypes.Maximize, 0, 0, 100);
setDependencies(“ProfitableMonths”, “TotalDataDays”);
}
//————————————————————————
@Override
public double compute(SQStats stats, StatsTypeCombination combination, OrdersList ordersList, SettingsMap settings, SQStats statsLong, SQStats statsShort) throws Exception {
int profitMonths = stats.getInt(“ProfitableMonths”);
int totalMonths = stats.getInt(“TotalDataMonths”);
return SQUtils.round2(SQUtils.safeDivide(profitMonths, totalMonths) * 100);
}
}

0

3件の返信を表示中 - 1 - 3件目 (全3件中)