Topic: Mt4-FST Expert.mq4

Mt4-FST Expert.mq4 is the Expert Advisor you have to start on your MeatTrader terminal in order to establish connection between both programs.

...
...

to be continued smile

Re: Mt4-FST Expert.mq4

Add Magic to enable MT4-FST Expert to control trade that is taken by itself only



#property copyright "Copyright © 2009, Miroslav Popov"
#property link      "http://forexsb.com/"

//| add MagicNumber to control trade generated by FSB only |

extern int MagicNumber = 33832795;

//| end of modification                                                             |

#define SERVER_SEMA_NAME "MT4-FST Expert"
#define EXPERT_VERSION         "0.9 Beta"

Re: Mt4-FST Expert.mq4

Many new features will be available tomorrow including this one. I'm going to publish a newer version with totally changed EA. The most important changes will be possibility to work on several charts and properly adding / reducing be opening multiple positions.

Re: Mt4-FST Expert.mq4

There are two external variables in version 0.11 Beta:

http://s1.postimage.org/y7MaA.jpg

- Connection_ID - the ID is an Integer between 0 and 1000. It serves for identification of the expert when there are several experts started on different charts. Each of them has to be started with  unique ID number. The same ID number has to be set in different running copy of FST.

how it works:
1. Start the expert with unique   Connection_ID number. Let's say 11.

2. Allow multiple working copies of FST from Tools menu.
http://s4.postimage.org/1Y5dt9.jpg

3. Set the same ID as in the expert.
http://s1.postimage.org/y9Dpi.png

4. You are connected
http://s1.postimage.org/y9PT0.jpg


- LateStops - when this option is enabled, the expert sends order without SL and TP. After that it modifies the position and sets the SL and TP. This is necessary for some brokers as FXCM.

Re: Mt4-FST Expert.mq4

In this 0.8.0.0 version, the program crash when the "Chart" and "Operation" tab is click on. 

When using the Expert Advisor in MT4, it innitially is connected then then disconnect and the FST disappear or crashed.

Re: Mt4-FST Expert.mq4

Melvin Lau wrote:

When using the Expert Advisor in MT4, it initially is connected then then disconnect and the FST disappear or crashed.

It seams there are remains of the previous expert or dll. If so, delete any of the following files. (MT to be stopped):

Folder "C:\Program Files\MetaTrader\experts"
- Delete MT4-FSB Expert.mq4
- Delete MT4-FSB Expert.ex4
- Delete mqlcache.dat

From "C:\Program Files\MetaTrader\experts" press "Compatibility Files" button (Win Vista,...)
- Delete MT4-FSB Expert.mq4
- Delete MT4-FSB Expert.ex4
- Delete mqlcache.dat

Folder "C:\Program Files\MetaTrader\experts\libraries"
- Delete MT4-FST Library.dll
- Delete mqlcache.dat

From "C:\Program Files\MetaTrader\experts\libraries" press "Compatibility Files" button (Win Vista,...)
- Delete MT4-FST Library.dll
- Delete mqlcache.dat

Reinstall Forex Strategy Trader or install the expert and the dll manually.

Re: Mt4-FST Expert.mq4

After starting the expert check the expert and the dll versions:


http://s3.postimage.org/bAbqr.jpg

Re: Mt4-FST Expert.mq4

I do not think the problem lies with the files at MT4 as this is a fresh installation into a computer that do not have any previously installed with FST (any version)


I think the problem lies with the new version of FST 0.8.0.0 not functioning properly in my computer ( XP ) , as I mention earlier when I click on the "Chart" or "Operation" tab in FST, the program (FST) disappear or crash.

When "MT4 FST Expert" is loaded onto the MT4 chart it shutdown the FST program.

http://s2.postimage.org/Xn9Ar.jpg

Re: Mt4-FST Expert.mq4

What is the localization setting of your computer? Try with English / US.

Start expert without FST. Are versions correct: DLL 0.11, Expert 0.11 Beta?
Start FST and not click the Chart or Operation tabs. Is the connection established?

Re: Mt4-FST Expert.mq4

Computer is set in English/US

Follow as per your posting, started EA without FST but in the journal the message is as before there is no indication of DLL (any version) nor does the expert have any version

This is all in the journal
2009.12.14 11:01:49    Expert MT4-FST Expert EURUSD,M5: loaded successfully

If I follow your instruction
"
Connection to MetaTrader

    * MetaTrader
          o Start MetaTrader;
          o Login to your account;
          o Open the chart for the desired Symbol and Period;
          o Start the expert advisor MT4-FST Expert;
    * Forex Strategy Trader
          o Start Forex Strategy Trader;
          o Open or set your strategy;
          o Click the Start Automatic Execution button.
"

After starting the MT4-FST Expert on the chart, when I try to start Forex Strategy Trader it open briefly and then close by itself.

If the Start Forex Strategy Trader and latter start the MT4-FST Expert, it will close the FST program, in the chart it will indicate connected for a while and then disconnect.

I tired for the mini and standard account with the same result.

Re: Mt4-FST Expert.mq4

Start the expert without FST and check "Experts" tab of MT. You have to see dll and expert versions there.
What I want to see is: MT4-FST Library Version 0.11 loaded successfully.

Re: Mt4-FST Expert.mq4

OK this is what I see,

2009.12.14 11:19:59    MT4-FST Expert EURUSD,M5: The environment test was accomplished successfully.
2009.12.14 11:19:59    MT4-FST Expert EURUSD,M5: MT4-FST Library version 0.11 loaded successfully.
2009.12.14 11:19:59    MT4-FST Expert EURUSD,M5: MT4-FST Expert version 0.11 Beta was started. An environment test is running...
2009.12.14 11:19:59    MT4-FST Expert EURUSD,M5 inputs: Connection_ID=0; LateStops=false;
2009.12.14 11:19:58    MT4-FST Expert EURUSD,M5: loaded successfully

Re: Mt4-FST Expert.mq4

That's OK.

1. Start FST alone without MT. Test the tabs and the buttons of the first tab "Status". Make and post a screen shot.

2. Stop MT and FST.
Disconnect your internet connection.
Start MT and the Expert.
Start FST. It should connect to MT and to receive the data.

Re: Mt4-FST Expert.mq4

For (1)
http://s3.postimage.org/bKmt9.jpg

Additional info,
When I check "Allow multiple copies of FST", the FST program can stays on BUT when I enter the "Set connection ID" to the number in the EA, the FST program will close by itself.

Re: Mt4-FST Expert.mq4

The program uses Named Pipes to communicate with MT.

Check the pipes with the attached program.

When both Expert and FST are running you have to see these two pipes:


http://s3.postimage.org/bKNUJ.jpg

When you close the programs, the pipes must disappear.

ID = 0 for single mode.

Post's attachments

Named Pipes Detector.zip 17.66 kb, 26 downloads since 2009-12-14 

You don't have the permssions to download the attachments of this post.

Re: Mt4-FST Expert.mq4

What is the name of your broker. If it contains special symbols it can break the comunication.
Please make the following test:
Go to line 356 of the expert and change:

FST_TerminalInfo(Connection_ID, TerminalName(), TerminalCompany(), TerminalPath(), EXPERT_VERSION);

to

FST_TerminalInfo(Connection_ID, "TerminalName", "TerminalCompany", "TerminalPath", EXPERT_VERSION);

Re: Mt4-FST Expert.mq4

After running Named Pipes Detector the first time, I did manage to get the FST to connect to MT4 so I redo it without "Named Pipes Detector" and it behave the same way. I then duplicate the conditions when I first ran Named Pipes Detector but FTS closes by itself an this is the output after clicking the button.

65 >FST-MT4_Pipe_ID-0<
64 >Winsock2\CatalogChangeListener-a6c-0<
63 >net\NtControlPipe39<
62 >RapAppRpcInterface<
61 >ROUTER<
60 >net\NtControlPipe36<
59 >PIPE_EVENTROOT\CIMV2SCM EVENT PROVIDER<
58 >net\NtControlPipe35<
57 >net\NtControlPipe34<

Re: Mt4-FST Expert.mq4

and this is after MT4 is close manually

64 >Winsock2\CatalogChangeListener-a6c-0<
63 >net\NtControlPipe39<
62 >RapAppRpcInterface<
61 >ROUTER<
60 >net\NtControlPipe36<
59 >PIPE_EVENTROOT\CIMV2SCM EVENT PROVIDER<
58 >net\NtControlPipe35<
57 >net\NtControlPipe34<

Re: Mt4-FST Expert.mq4

OK. Lets try with a previous version of FST without Pipes ID.
Yo have to uninstall FST and to delete expert's ex4 and mqlcache.dat

Re: Mt4-FST Expert.mq4

Popov wrote:

What is the name of your broker. If it contains special symbols it can break the comunication.
Please make the following test:
Go to line 356 of the expert and change:

FST_TerminalInfo(Connection_ID, TerminalName(), TerminalCompany(), TerminalPath(), EXPERT_VERSION);

to

FST_TerminalInfo(Connection_ID, "TerminalName", "TerminalCompany", "TerminalPath", EXPERT_VERSION);

After removeing the brackets "()" and compiling, it has the following errors

',' - left parenthesis expected    C:\Program Files\Interbank FX Trader 4\experts\MT4-FST Expert.mq4 (356, 65)
',' - left parenthesis expected    C:\Program Files\Interbank FX Trader 4\experts\MT4-FST Expert.mq4 (356, 82)
',' - left parenthesis expected    C:\Program Files\Interbank FX Trader 4\experts\MT4-FST Expert.mq4 (356, 96)
'iLastError' - internal error    C:\Program Files\Interbank FX Trader 4\experts\MT4-FST Expert.mq4 (1234, 12)

Off course broker is Interbank FX.

Re: Mt4-FST Expert.mq4

I also have Interbank FX terminal and FST works fine. I'm asking because in your screen shot the symbol is EURUSDm but mine is EURUSD.

PS.
After removing the brackets put quotation marks.

Re: Mt4-FST Expert.mq4

Sorry, for got the " ........" now no compilation error but FST still close by itself.

Re: Mt4-FST Expert.mq4

It looks like the problem lies with the communication between FTS and the EA. Now I again manage to establish the connection with the modified EA ( there was numerious unsuccessful connection with the same setup)

http://s1.postimage.org/yZxtA.jpg

Re: Mt4-FST Expert.mq4

What I see is FST stops alone when it connects to MT. I have seen before such behaviour due to localization problems (1,2345 instead 1.2345). I'm surprised that FST doesn't rise any warning or error message.

Can you download another MT terminal from other broker or from MetaQutes http://www.metatrader4.com/files/mt4setup.exe?

Reinstall FST or copy DLL and the expert manually.

Re: Mt4-FST Expert.mq4

In your last screen the symbol is EURUSD, but before it was EURUSDm. What was changed?