読み取り専用

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

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

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

ご参加ください Discord YouTube

Assistance on code to get backtest to work

2件の返信

マット・エドモンズ

定期購読者、bbp_participant、顧客、コミュニティ、42件の返信。.

プロフィールを表示

5年前 #268819

I have an EA that trades against the trend in M1 timeframe, looking for a reversal. It can get big drawdowns when the 20 pip stop loss is hit and it re-opens a position again.

I have added code to try to stop this from happening by using at the start of the trade entry condition:

Closed P/L in Pips > -19

or Bars since Order Closed > 500 (in M1 this is 500 minutes)

 

The problem that I have is that it wont start the first trade in backtest as it won’t meet either of these conditions, so it doesn’t trade.

To try to resolve this I added:

or Market Positions Count = 0

which I would have assumed would get the first trade started, but it still isn’t back testing. Any suggestions to get it to work?

 

ありがとう、,

マット

0

Tomas Matejka

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

プロフィールを表示

5年前 #268871

こんにちは,

you can add this into your condition to make the strategy open the first trade even if there was no trade previously open

if (Bars since Order Closed == -1) OR (… your existing condition …)

If the function cannot find a previous order (it will be the first trade) it return value = -1

お役に立ちましたらお知らせください

0

マット・エドモンズ

定期購読者、bbp_participant、顧客、コミュニティ、42件の返信。.

プロフィールを表示

5年前 #268877

Fantastic thanks Tomas, really appreciate all your assistance. Will try it out.

0

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