読み取り専用

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

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

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

ご参加ください Discord YouTube

パラメータ値の変更

3件の返信

chengsmine

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

プロフィールを表示

13年前 #111615

I have an initial value of a certain parameter DS set to be 5 (input)) when the EA starts. After the closing of some trades, DS is increased to 10. But it appears that this new value has not replaced the original value of DS when the EA restarts. For example,

Input:  DS=5;

 

ルール1:

PU= Open (0) + ConvetToRealPips(DS)

 

After many rules:

Close all orders

DS=DS+5

 

So the new value of DS is now 10, But DS is found to be still <=5 in Rule 1 when the EA restarts (returns to Rule 1).

 

Why? Is there a solution to this problem?

 

0

マーク・フリック

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

プロフィールを表示

13年前 #122729

when you restart an EA, it will forget all the values that were stored in memory and it will use default values again.

There’s no easy solution for it, it simply works like this.

 

The only way to keep some previous values from before EA restart would be to save it to a file and then load it again.

 

Or you can try to recognize DS from your orders – for example if you use different size with each order you can use the size of actual order to recognize what DS value was used last time.

 

マーク

マーク
StrategyQuantアーキテクト

0

chengsmine

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

プロフィールを表示

13年前 #122733

How can you remember the size of the last order, you mention above that all values that were stored in memory are erased once you restart an EA?

0

マーク・フリック

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

プロフィールを表示

13年前 #122751

you cannot remember value of last order, but you can get it from orders history.

 

Just add this function to the end of {EA Wizard}/code/CustomFunctions.mq4 file:

 

double sqGetLastPositionSize(int orderMagicNumber) {
   for(int i=OrdersHistoryTotal(); i>=0; i–) {
      if(OrderSelect(i,SELECT_BY_POS,MODE_HISTORY)==true && OrderSymbol() == Symbol()) {
         if(orderMagicNumber == 0 || OrderMagicNumber() == orderMagicNumber) {
            return(OrderLots());
         }
      }
   }
 
   return(0);
}

 

Then you can use it in conditions by calling Custom Function : sqGetLastPositionSize(YourMagicNumber)

 

マーク

マーク
StrategyQuantアーキテクト

0

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