読み取り専用

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

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

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

ご参加ください Discord YouTube

新しいローソク足でトレードを開始

27 replies

ゆっくりでも確実に

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

プロフィールを表示

12年前 #112139

こんにちは

 

I just want a rule that says as soon as a new candle opens, then enter a trade.  Can anyone tell me how?\

 

ありがとう

 

0

ゆっくりでも確実に

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

プロフィールを表示

12年前 #124663

On the Open P/L I can see it has a magic number, so its only going to look at the trade with that magic number.  The only thing I can think of is that the value in pips of both trades should be assigned a variable each, and then the two variables added together.  I just can’t see how to do it?

0

ゆっくりでも確実に

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

プロフィールを表示

12年前 #124664

I think I solved that.  But its still not opening trades on the 2nd currency pair.  Can you take a look at the strategy file attached and see if I have done anything wrong?

 

ありがとう

ファイル Hedge.sqw

0

ゆっくりでも確実に

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

プロフィールを表示

12年前 #124665

hmm fixed it.  

0

ゆっくりでも確実に

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

プロフィールを表示

12年前 #124668

One last problem with this strategy…

I am adding the open p/l together for both currencies and the rule is, if the total profit is >= 5 pips then close both trades.

However, its closing at 5 pips regardless of whether its 5 pips profit or 5 pips loss, or 3 pips profit and 2 pips loss etc.

How do I ensure it only closes when the open p/l is positive 5 pips?

0

ゆっくりでも確実に

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

プロフィールを表示

12年前 #124734

I am adding the open p/l together for both currencies and the rule is, if the total profit is >= 5 pips then close both trades.

However, its closing at 5 pips regardless of whether its 5 pips profit or 5 pips loss, or 3 pips profit and 2 pips loss etc.

How do I ensure it only closes when the open p/l is positive 5 pips?

0

マーク・フリック

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

プロフィールを表示

12年前 #124737

can you attach your strategy here? it should recognize between positive and negative PL.

マーク
StrategyQuantアーキテクト

0

ゆっくりでも確実に

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

プロフィールを表示

12年前 #124740

Here it is.

ファイル Hedge.sqw

0

マーク・フリック

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

プロフィールを表示

12年前 #124765

I looked at this, the problem is that the function Open PL always checks the PL only in current chart symbol. It is because you can use 0 as magic number, 
and it will return open profit for all trades on the same symbol.

The solution is to use custom function, but don’t worry, it is not complicated.

Open file EA Wizard/code/CustomFunctions.mq4 and add the following function there:

 
double sqGetOpenPLInPips2(int MN1, int MN2) {
   double pl = 0;
 
   for (int cc = OrdersTotal() - 1; cc >= 0; cc--) {
      if (!OrderSelect(cc, SELECT_BY_POS) ) continue;
      if(OrderType() != OP_BUY && OrderType() != OP_SELL) continue;
      if(OrderMagicNumber() != MN1 && OrderMagicNumber() != MN2) continue;
 
      if(OrderType() == OP_BUY) {
         pl += sqGetBid(OrderSymbol()) – OrderOpenPrice();
      } else {
         pl += OrderOpenPrice() – sqGetAsk(OrderSymbol());
      }
   }
 
   return(pl*gPointPow);
}
 
then you can use this custom function in EA Wizard, I’m attaching a strategy that shows how to call it to get PL of two orders with different magic numbers combined.
 
 
ファイル Hedge.sqw

マーク
StrategyQuantアーキテクト

0

ゆっくりでも確実に

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

プロフィールを表示

12年前 #124778

Thanks Mark, thats very helpful.

0

Eddiebund

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

プロフィールを表示

12年前 #125372

マーク

 

This is a very interesting strategy which I was looking test.  Unfortunately, when i add the code above to CustomFunctions it doesn’t compile and shows the errors

 

‘sqGetBid’ – function not defined CustomFunctions2.mq4 29 16
‘sqGetAsk’ – function not defined CustomFunctions2.mq4 31 35
‘gPointPow’ – undeclared identifier CustomFunctions2.mq4 35 14
event handling function not found 1 1
4 error(s), 0 warning(s) 5 1
 

 

Actually when I removed the additional code the last 2 errors still exist

 

Can you advise please

 

ありがとう

 

Eddie

0

マーク・フリック

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

プロフィールを表示

12年前 #125394

Hello Eddie,

 

are you trying to compile the COmpiledFunctions.mq4 file by itself?

 

It isn’t supposed to work like this. The contents of this file is attached to every EA created in EA Wizard, so don’t compile this custom file, but normal EA that you export from EA Wizard.

It should have these functions already included.

マーク
StrategyQuantアーキテクト

0

Eddiebund

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

プロフィールを表示

12年前 #125409

Thanks for that Mark

 

It is now working and gives me the basis of something to try and develop

 

 

乾杯

0

12件の返信を表示中 - 16 - 27件目 (全27件中)

1 2