読み取り専用

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

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

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

ご参加ください Discord YouTube

Divide biggest MAE by current account balance

返信 0 件

マイケル

定期購入者、bbp_participant、5件の返信.

プロフィールを表示

5年前 #268911

皆様、こんにちは、,

I want to show the biggest MAE in %. For this, the biggest MAE should be divided by the current account balance and mulitplied by 100. The code for biggest MAE is the following:

パッケージ SQ.Columns.Databanks;

import com.strategyquant.lib.L;
import com.strategyquant.lib.SettingsMap;
import com.strategyquant.tradinglib.DatabankColumn;
import com.strategyquant.tradinglib.Order;
import com.strategyquant.tradinglib.OrdersList;
import com.strategyquant.tradinglib.SQStats;
import com.strategyquant.tradinglib.StatsTypeCombination;
import com.strategyquant.tradinglib.ValueTypes;

public class BiggestMAE extends DatabankColumn {

public BiggestMAE() {
super(L.t(“Biggest MAE”), DatabankColumn.Decimal2PL, ValueTypes.Minimize, 0, 0, 100);

setWidth(70);

setTooltip(L.t(“Biggest MAE – is the worst Maximum Adverse Excursion of all trades”));
}

//————————————————————————

@Override
public double compute(SQStats stats, StatsTypeCombination combination, OrdersList ordersList, SettingsMap settings, SQStats statsLong, SQStats statsShort) throws Exception {
double worstMAE = -Double.MAX_VALUE;

for(int i = 0; i<ordersList.size(); i++) {
Order order = ordersList.get(i);

if(order.MAE > worstMAE) {
worstMAE = order.MAE;
}
}

return -1*worstMAE;
}

}

Can someone help me in finding the current account balance of the trade and divide the variable worstMAE by it? I think the function AccountBalance from the class Order should suffice, but I don’t get it to work.

0