読み取り専用

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

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

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

ご参加ください Discord YouTube

Order executed in the middle of the bar and not at the beginning or at the end of the bar after restarting MT4…

5件の返信

カリス

カスタマー、bpb_participant、コミュニティ、sq-ultimate、414件の回答。.

プロフィールを表示

10年前 #115240

HIi, i got a problem..

 

The EA is working fine by the rules and opens and close orders on bar open/close,

but when lets say i restart my MT4 platform when it opens again and the rules are met, it will open an order immediately at the middle of the bar without waiting for a new formatted bar..

 

how do i stop it for happening please?, i want the EA to wait for a new formatted bar and then enter the order (like it should) and not on the first tick when restarting the MT4 platform or so..

 

thanks..

0

カリス

カスタマー、bpb_participant、コミュニティ、sq-ultimate、414件の回答。.

プロフィールを表示

10年前 #137719

@Mark @Thomas ?..,

 

that happens to me when i’m using offline charts.., maybe something to do with “sqIsBarOpen”  under the “drawStats()” function?…, please help ASAP…, because when i’m im reopening MT4 platform with an EA that works on OFFLINE charts it will just open a new position as soon as the first tick comes in, and wont wait till the new bar opens….,

 

waiting for some help…!, thank you!…

0

カリス

カスタマー、bpb_participant、コミュニティ、sq-ultimate、414件の回答。.

プロフィールを表示

10年前 #137740

Anybody………….?

0

Tomas Matejka

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

プロフィールを表示

10年前 #137759

こんにちは、,

 

it seems to me that EA/chart load event causes isBarOpen to be true within DrawStats function. That is why the action is triggered. I will ask Mark to check it

0

カリス

カスタマー、bpb_participant、コミュニティ、sq-ultimate、414件の回答。.

プロフィールを表示

10年前 #137775

こんにちは、,

 

it seems to me that EA/chart load event causes isBarOpen to be true within DrawStats function. That is why the action is triggered. I will ask Mark to check it

Thanks thomas, i would love to hear how can i fix that issue ASAP please..!\

thanks again i will wait for an answer..!

0

マーク・フリック

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

プロフィールを表示

10年前 #137989

Karish, I looked at it and yes, this is how it works. When you start your EA in the middle of the bar it can open the order immediately, it doesn’t wait for start of a new bar.

 

The recognition of new bar open checks if it is a first tick of the current bar, which it is when you just started EA in the middle of the bar.

 

It is actually quite difficult to make it work only for the new open bars and not for the first bar you start your EA with.

 

It should possible by changing the MQL code a little – find a function drawStats() where the variable sqIsBarOpen is set.

 

Change the condition like this:

 

   if(tmp != Time[0] && Volume[0] < 5 ) {}
      tmp =  Time[0];
      open = Open[0];
      sqIsBarOpen = true;
   } else {
      sqIsBarOpen = false;
   }
 
This will check that also volume of the checked tick must be smaller than 5, so it should filter our the cases when it is checked in the middle of bar.
Please test it before you’ll use it.

マーク
StrategyQuantアーキテクト

0

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