Topic: mt5 bridge for fsb pro

Is there an mt5 bridge for fsb pro?
Some indicators are almost impossible to code in mql and only the bridge can enable us trade.
Currently I see only an mt4 bridge in the user files

Re: mt5 bridge for fsb pro

Naya wrote:

Is there an mt5 bridge for fsb pro?
Some indicators are almost impossible to code in mql and only the bridge can enable us trade.
Currently I see only an mt4 bridge in the user files

Yes, I also have the questoin same as you.

Re: mt5 bridge for fsb pro

We created the Bridge expert to connect and trade FSB strategies with MT4. It was around 2014.
In 2015 we introduced the possibilities to export Expert Advisors.

The Bridge expert and dll are open source and are available here: https://github.com/PopovMP/MT4-FST-Library.dll

If you wish, you can modify it for MT5.
However, the MQL language much better now. Such functionality can be created with pure MQL.

I'm working on a new software now, which will replace FSB Pro.

Re: mt5 bridge for fsb pro

Popov wrote:

We created the Bridge expert to connect and trade FSB strategies with MT4. It was around 2014.
In 2015 we introduced the possibilities to export Expert Advisors.

The Bridge expert and dll are open source and are available here: https://github.com/PopovMP/MT4-FST-Library.dll

If you wish, you can modify it for MT5.
However, the MQL language much better now. Such functionality can be created with pure MQL.

I'm working on a new software now, which will replace FSB Pro.


Thanks for the clarification Popov.
I am glad you are working on a new software...
But is it going to allow custom indicators? EA studio and mqlgen don't allow that only fsb pro

Re: mt5 bridge for fsb pro

Popov wrote:

We created the Bridge expert to connect and trade FSB strategies with MT4. It was around 2014.
In 2015 we introduced the possibilities to export Expert Advisors.

The Bridge expert and dll are open source and are available here: https://github.com/PopovMP/MT4-FST-Library.dll

If you wish, you can modify it for MT5.
However, the MQL language much better now. Such functionality can be created with pure MQL.

I'm working on a new software now, which will replace FSB Pro.

Hi, Popov. Can you modify MT4 to MT5 bridge? Because I no have any coding skill to modify. Can you help me?

6 (edited by Naya 2025-10-15 12:49:28)

Re: mt5 bridge for fsb pro

Popov wrote:

We created the Bridge expert to connect and trade FSB strategies with MT4. It was around 2014.
In 2015 we introduced the possibilities to export Expert Advisors.

The Bridge expert and dll are open source and are available here: https://github.com/PopovMP/MT4-FST-Library.dll

If you wish, you can modify it for MT5.
However, the MQL language much better now. Such functionality can be created with pure MQL.

I'm working on a new software now, which will replace FSB Pro.



I HAVE TRIED TO IMPLEMENT IT FOR MT5 BUT ITS QUITE TOUGH....PLEASE CAN YOU HELP....




After studying this MT4-FST Library code in detail, I can provide you with a comprehensive analysis and recommendations for building communication between MT5 and FSB Pro.

## Analysis of the Current Architecture

The current MT4-FST Library uses a **named pipes** communication system with this structure:

```
Forex Strategy Trader (FST) ↔ MT4-FST Library DLL ↔ MT4 Expert Advisor
```

Key components:
1. **MT4 Expert Advisor** (`MT4-FST Expert.mq4`) - Runs in MetaTrader 4
2. **Bridge DLL** (`MT4-FST Library.dll`) - C++ DLL that handles communication
3. **Named Pipes** - Inter-process communication between FST and DLL
4. **Client/Server model** - DLL acts as server, FST acts as client

## Options for MT5 Integration

### Option 1: Complete Rebuild (Recommended)

You'll need to rebuild the bridge completely because:

1. **MT5 API is fundamentally different** from MT4
2. **MQL5 is object-oriented** vs MQL4's procedural approach
3. **Different DLL import mechanisms**
4. **Changed order management system**

#### Steps for Complete Rebuild:

**A. Create MT5 Expert Advisor (MQL5)**
```cpp
// New MT5 version would need to handle:
// - Different account information structure
// - New order management functions (PositionGet, OrderSend)
// - Different symbol information structure
// - MQL5's object-oriented approach
```

**B. Create New Bridge DLL (C++)**
- Update to use MT5's API structures
- Maintain similar named pipes communication
- Handle MT5's position-based system vs MT4's order-based system

**C. Modify FSB Pro Client**
- May need updates to handle any protocol changes
- Keep similar command structure if possible

### Option 2: Proxy Approach

You could create a proxy that translates between MT4 and MT5:

```
FSB Pro → MT4-FST Proxy → MT5 Expert
```

This would involve:
1. Running the existing MT4-FST Library
2. Creating a translation layer that converts MT4 commands to MT5
3. Developing an MT5 expert that understands the translated commands

### Option 3: Hybrid Approach

Use the existing DLL communication but create a new MQL5 wrapper:

```
FSB Pro → Existing DLL → MQL5 Adapter → MT5 Native Functions
```

## Recommended Best Practice

### 1. **Complete Rebuild with Protocol Preservation**

I recommend a complete rebuild but preserving the communication protocol where possible:

**Keep the same:**
- Named pipes communication
- Command structure (PI, SI, MA, OS, OC, etc.)
- Basic message format

**Update:**
- MT5-specific data structures
- New position management system
- MQL5 function calls
- Error handling for MT5

### 2. **Implementation Steps**

**Phase 1: MQL5 Expert Advisor**
```cpp
// Create new MT5 version with:
class MT5FSTExpert : public CExpert
{
    // Handle MT5's event-driven model
    // Implement OnTick, OnTrade, OnTimer
    // Use PositionGet*, OrderSend* functions
}
```

**Phase 2: Updated Bridge DLL**
- Update data structures for MT5
- Maintain backward compatibility with FSB Pro
- Handle MT5's different market data format

**Phase 3: Testing and Optimization**
- Test with MT5's strategy tester
- Optimize for MT5's multi-currency/multi-timeframe capabilities

### 3. **Key Technical Challenges**

1. **Position vs Order Management**: MT5 uses position-based accounting vs MT4's order-based
2. **Hedging Mode**: MT5 has different hedging capabilities
3. **Symbol Specifications**: Different market info structure
4. **Execution Model**: MT5's more complex execution model

### 4. **Sample MQL5 Structure**

```cpp
#include <Trade\Trade.mqh>
#include <Trade\SymbolInfo.mqh>

class FST_MT5_Bridge
{
private:
    CTrade trade;
    CSymbolInfo symbol;
    int connection_id;
   
public:
    bool Connect(int id);
    void ProcessTick();
    void HandleFSTRequest();
    // ... other methods
};
```

## Conclusion

**You need to rebuild the bridge completely** but can preserve much of the communication protocol. The named pipes approach and command structure can remain similar, but the MT5 integration layer must be entirely new due to fundamental differences between MT4 and MT5 architectures.

The most efficient approach would be to:
1. Study MT5's API thoroughly
2. Create a new MQL5 expert advisor
3. Update the bridge DLL for MT5 compatibility
4. Maintain the existing FSB Pro interface

This preserves your investment in FSB Pro while creating a modern MT5-compatible solution.

Re: mt5 bridge for fsb pro

> This preserves your investment in FSB Pro while creating a modern MT5-compatible solution.

Thank you, Naya!

I love programming backtesting software so much that I don't think of it as an investment.

However, I prefer working now on a better Expert Advisors structure than on the bridge.

8 (edited by Naya 2025-10-24 11:19:23)

Re: mt5 bridge for fsb pro

Popov wrote:

> This preserves your investment in FSB Pro while creating a modern MT5-compatible solution.

Thank you, Naya!

I love programming backtesting software so much that I don't think of it as an investment.

However, I prefer working now on a better Expert Advisors structure than on the bridge.

thank you popov.
i use multiple strategy development platform like fsb pro  and i actually deal with many custom indicators that are preferable used via the bridge. there are many indicators i build for fsb pro(e.g trendline indicators) that reproducing it in mql is almost impossible except you are ready to accept a max of 85-90% match!

i recently stopped using MA based indicators completely(i dont use any builtin indicator in fsb pro apart from time filters, long/short, nbar exit and other built in simple price action indicators)...so i am bound to my few pure price action based custom indicators that work best via the bridge.

please i realy need the bridge  implemented for mt5.


i also noticed in recent work with custom indicators that fsb indicators have limits on listparam, numparam and checkparam....please could that be expanded further i notice check param are limited to a max of 2 per indicator could you expand it to 5 for future releases and also expand teh list and num parameter limits?....this will really help in custom indicator development.