読み取り専用

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

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

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

ご参加ください Discord YouTube

EA Strategy Problem

1件の返信

sdb

購読者、bbp_participant、コミュニティ、37件の返信。.

プロフィールを表示

11年前 #112766

皆さん、こんにちは,

 

Ok, here is my problem, Let’s say that I want to create a strategy with EA Wizard. The strategy is simple.

 

Whenever CCI crosses below than “-50”  and momentum < 100 then enter “Short” and the opposite.

Whenever CCI crosses above than “+50” and momentum > 100 then enter “Long:

“Close all positions” each time CCI crosses “0”.

 

Enter At Market                                  CCI                                          MO

Symbol: Current                         Symbol: Current                        Symbol: Current

Direction: Short                          Timeframe: Current                  Timeframe: Current

Quantity: 1.0                               Period: 24                                 Period: 50

Magic Number: 1000                 Apply to: Close                          Apply to: Close

Profit Target: 20                         Shift: 1                                      Shift: 1

 

The problem is that:

 

 

Let’s say that Momentum is already on the price of “94” (meaning < than 100).

When the price of CCI is playing, between -49 and -51 (meaning that crosses CCI) for 25 times until the price be stable somewhere lower or higher, the strategy have already opened 25 entries to the market.

 

If I give order CCI < -50 and momentum < 100, then each time the candle closes below -50 , again one order will be open “Shortly”

 

 

What I am doing wrong? What do I have to do in order the strategy to take place only at once?

 

 

 

0

マーク・フリック

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

プロフィールを表示

11年前 #126988

you again posted this to StrategyQuant section, please post EA Wizard questions to EA Wizard section!

 

I don’t fully understand the logic of your strategy, could you post the sqw file here?

マーク
StrategyQuantアーキテクト

0

sdb

購読者、bbp_participant、コミュニティ、37件の返信。.

プロフィールを表示

11年前 #127006

I’m really sorry Mark I posted here. Didn’t do it on purpose. When I realized it, it was too late.

 

Ok, So the strategy is simple.

 

I want to “Buy” When Momentum is > 100 and at the same time when CCI crosses above 50

I want to “Sell” When Momentum is < 100 and at the same time when CCI crosses below-50.

 

We all know that market price goes up and down all the time. The same for the price of CCI and Momentum in this example.

Now, consider that the strategy is running and Momentum is already around to 120 (which means the strategy will execute a “Buy” order), but the price fluctuate between 49 and 51 some times when finally goes up to 75.

 

My problem is that for these few times that the price was fluctuating between 49 and 51 the strategy was executing more than 1 “Buy” orders.

But of course this it doesn’t happen always.

 

So my questions are:

Is there any way to adjust the strategy avoiding open more than 1 order?

Is there something wrong with this strategy?

 

 

(Sorry, didn’t know how to post sqw file. I sent it via email.

 

Waiting for your reply.

Thanks for reading.

 

 

よろしくお願いいたします。,

0

sdb

購読者、bbp_participant、コミュニティ、37件の返信。.

プロフィールを表示

11年前 #127007

Otherwise I can post the code here if you want.

 

 

 

ありがとうございます

0

マーク・フリック

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

プロフィールを表示

11年前 #127014

it would help if you could post your sqw file here.

 

Do you mean that the EA opens trade, then closes it then open it again etc. as CCI fluctuates between 49 and 51?

Because EA has a protection that it shouldn’t open multiple trades to the same direction with the same magic number, so you shouldn’t have multiple trades opened to the same direction.

 

To fix the first problem you can use variable to keep track on number fo opened trades per trend, it was mentioned here together with an example:

https://strategyquant.com/forum/topic/2268-one-trigger-per-trend-conundrum/

 

The idea is that you’ll use variable to keep track on how many trades you opened since last momentum crossing, you can limit it to open just 1 trade.

マーク
StrategyQuantアーキテクト

0

sdb

購読者、bbp_participant、コミュニティ、37件の返信。.

プロフィールを表示

11年前 #127026

Actually this that I want to limit is CCI and not Momentum. Momentum in this strategy is coming 2nd as a confirmation curve to enter or not to the market, so I don’t want to limit trades according Momentum.

 

Maybe it will be helpful to say that the timeframe i’m using is a 4 Hour timeframe. All these we are talikng about fluctuation of CCI, are taking place in 1 candle of 4 hours!

 

So, is there any parameter to adjust in order the strategy to open no more than one trades / per candle ???

 

(I don’t know how to post the sqw file here. Copy paste doesn’t work. Do you want me to post the hole code of the strategy?)

 

 

ありがとうございます

0

sdb

購読者、bbp_participant、コミュニティ、37件の返信。.

プロフィールを表示

11年前 #127049

Hello Mark! Here is the sqw file you asked for.

 

 

ファイル Strategy_CCI_MO.sqw

 

 

Please have a look and tell me if there is a posibility, this strategy to open double or trible or more trades in a one 4hour candle (I use the strategy in a 4Hour Timeframe).

 

ありがとうございます

0

sdb

購読者、bbp_participant、コミュニティ、37件の返信。.

プロフィールを表示

11年前 #127050

And by the way, I noticed a small delay of strategy’s activation. (Apply to: Close) 

 

Is there anything we can do so the strategy to be ativated when the candle is closing??  

0

sdb

購読者、bbp_participant、コミュニティ、37件の返信。.

プロフィールを表示

11年前 #127051

It works excellent in a 1 min Timeframe, but not in a 4 hour Timeframe.

 

ありがとうございます

0

マーク・フリック

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

プロフィールを表示

11年前 #127160

こんにちは,

 

I looked at this strategy, sorry it took me so long.

 

But it seems ok, can you tell me what exactly is wrong with it?

 

I understand that you want it to place just one trade per 4 hour candle, right?

 

What exactly is the problem?

 

1. that it opens a trade, it hits SL or PT and then opens the same trade on the same candle?

 

2. or that it opens multiple trades on the same candle at the same time – so you have more than one open positions?

 

If the problem is 1.) the solution is simple – add condition Order Opened This bar is False that will check if order was already opened on the current bar.

 

I’m attaching modified strategy.

 

 

 

ファイル Strategy_CCI_MO.sqw

マーク
StrategyQuantアーキテクト

0

sdb

購読者、bbp_participant、コミュニティ、37件の返信。.

プロフィールを表示

11年前 #127204

Well, the problem seems to be the first one:

 

That it opens a trade, it hits SL or PT and then opens the same trade on the same candle.

 

I ll test the strategy you sent me and I will inform you.

 

By the way, the strategy I have already create it will stop working if the trial expires ???

 

 

ありがとうございます

0

sdb

購読者、bbp_participant、コミュニティ、37件の返信。.

プロフィールを表示

11年前 #127255

Ok Mark I did what you said and it’s ok now. But an another problem appeared.

 

If CCI is above 50 and Momentum Above 100 then we enter the market and it’s ok.

But if in the next 4hour candle the indicators continues to be above both of them, an another trade opens! I DON’T WANT THAT!

 

I want the strategy to open only one trade. But, if CCI falls below 50 and then goes again above 50 then to open a new trade.

 

The same if we go for “Short”

 

Do you think that this it can be done???

 

Please answer me  

0

マーク・フリック

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

プロフィールを表示

11年前 #127266

yes, this can be done, but you have to use variables to track the trend changes.

 

Example of strategy in pseudo code:

 

ルール1:

IF CCI falls below 0 and then returns back above 0

THEN Set variable TradesInNewTrend = 0

 

規則2:

if TradesInNewTrend=0 and your other condition

それから

open trade

Set variable TradesInNewTrend = 1

 

This will keep track on how many trades were opened for every trend change.

マーク
StrategyQuantアーキテクト

0

ピット

購読者、bbp_participant、コミュニティ、37件の返信。.

プロフィールを表示

11年前 #127407

こんにちは

マーク you can upload an example?

ルール 1:

もし CCI もし below 0 そして then returns back above 0

それから set variable TradesInNewTrend = 0

 

ルール 2:

もし TradesInNewTrend = 0 そして あなたの other condition

それから

open trade

Set variable TradesInNewTrend = 1

Thank ピット

0

マーク・フリック

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

プロフィールを表示

11年前 #127445

I’m attaching an example.

ファイル Example1.sqw

マーク
StrategyQuantアーキテクト

0

ピット

購読者、bbp_participant、コミュニティ、37件の返信。.

プロフィールを表示

11年前 #127703

ありがとう

 

ピット

0

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