読み取り専用

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

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

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

ご参加ください Discord YouTube

Custom Indicator Errors Coming From Translated MQL5 Code

2件の返信

l fe

登録者、bbp_participant、2件の返信。.

プロフィールを表示

1年前 #289644

皆さん、こんにちは。

I’m trying to translate the UTBot MQL5 indicator into StrategyQuant however I’m having a bit of trouble compiling my indicator.

I have no idea why I’m getting these errors coming from indicators.java.

If anyone has some guidance or any pointers as to why the error is happening I would really appreciate it.

Attached are the UTBot.java file which is my indicator

An image snippet of indicators.java which is where the errors are coming from, and the errors shown.

Many thanks 🙂

添付ファイル:
に違いない ログインしました 添付ファイルを表示するには.

1

l fe

登録者、bbp_participant、2件の返信。.

プロフィールを表示

1年前 #289645

Apologizes the .java file failed to attach, here is the custom indicator code

`
package com.strategyquant.indicators;

import com.strategyquant.tradinglib.*;
com.strategyquant.lib.*; をインポートする;
import com.strategyquant.datalib.*;
import static java.lang.Math.*;

/**
* UT Bot – port of Geraked’s MT5 indicator.
*
* • C1 – trailing channel line
* • Sig – +1 = Bull, –1 = Bear, 0 = Flat
*/
@BuildingBlock(
name = “UT Bot”,
display = “UT Bot (#Length# | #Coef#)”,
returnType = ReturnTypes.Number
)
public class UTBot extends IndicatorBlock {

@Parameter(name = “Length”, defaultValue = “10”, minValue = 1, isPeriod = true)
public int Length = 10;

@Parameter(name = “Coef”, defaultValue = “3.0”, minValue = 0.5, maxValue = 10, step = 0.1)
public double Coef = 3.0;

@Output(name = “C1”) public DataSeries C1;
@Output(name = “Sig”) public DataSeries Sig;

private ATR atr;

@Override
public void onInitialize() throws TradingException {
atr = Indicators.ATR(Length);
}

@Override
public void onBarUpdate() throws TradingException {
int i = series.index();
if (i == 0) {
C1.set(series.close(0));
Sig.set(0);
return;
}
double close = series.close(0);
double close1 = series.close(1);
double prevC1 = C1.get(i – 1);
double loss = atr.getValue(0) * Coef;

double t1 = close > prevC1 ? close – loss : close + loss;
double t2 = (close < prevC1 && close1 < prevC1) ? min(prevC1, close + loss) : t1; double newC1 = (close > prevC1 && close1 > prevC1)
? max(prevC1, close – loss) : t2;

int sig = 0;
if (close > newC1 && close1 <= prevC1) sig = 1;
if (close < newC1 && close1 >= prevC1) sig = -1;

C1.set(newC1);
Sig.set(sig);
}
}
`

0

Tomas Matejka

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

プロフィールを表示

1年前 #289764

If you seek programming help you can contact our developers directly. Check for more details: https://strategyquant.com/codebase/request-coding/

0

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