Showing Trades on Custom Symbol

 

Hello Team,

I'm looking to find out about whether or not it possible to show Opened Trades/Closed Trades on a Custom Symbol.

I have, for instance, coded a (rather ugly) means of extracting the Real Tradeable symbol from Custom Charts made with a Renko Utility:

   tradeSymbol = (_Symbol);
   string sep="_";
   ushort u_sep;
   string result[];
   u_sep=StringGetCharacter(sep,0);
   int k=StringSplit(tradeSymbol,u_sep,result);
   tradeSymbol=result[0];

This allows the EA to perform technical analysis on the Renko Chart (EURUSD_3PIPS) but trade on the Tradeable Symbol (EURUSD) using string tradeSymbol.

However, when backtesting, and running the EA, the trades are not shown on the Custom Symbol (EURUSD_3PIPS). This makes analysing the effectiveness of the trade logic challenging - I need to look at Trade times in the journal, then find the corresponding renko bar, and cross reference this with the Real tradeable symbol.

Is there a way to reflect on the CUSTOM SYMBOL the trades that have been placed on the Tradeable symbol? My only real requirement is the "In" point and "out" point - like in the attached image of a Standard Trading Symbol


Creating and testing custom symbols in MetaTrader 5
Creating and testing custom symbols in MetaTrader 5
  • www.mql5.com
Creating custom symbols pushes the boundaries in the development of trading systems and financial market analysis. Now traders are able to plot charts and test trading strategies on an unlimited number of financial instruments.
 
oneflewoverthecuckoosnest:

Hello Team,

I'm looking to find out about whether or not it possible to show Opened Trades/Closed Trades on a Custom Symbol.

I have, for instance, coded a (rather ugly) means of extracting the Real Tradeable symbol from Custom Charts made with a Renko Utility:

This allows the EA to perform technical analysis on the Renko Chart (EURUSD_3PIPS) but trade on the Tradeable Symbol (EURUSD) using string tradeSymbol.

However, when backtesting, and running the EA, the trades are not shown on the Custom Symbol (EURUSD_3PIPS). This makes analysing the effectiveness of the trade logic challenging - I need to look at Trade times in the journal, then find the corresponding renko bar, and cross reference this with the Real tradeable symbol.

Is there a way to reflect on the CUSTOM SYMBOL the trades that have been placed on the Tradeable symbol? My only real requirement is the "In" point and "out" point - like in the attached image of a Standard Trading Symbol


A couple o fdays ago, i also experienced a problem with the view of the trades after a test on a custom symbol (not missing, but mEssing, meaning the signs where anywhere in the charts, but not where price was ;)

But a couple of hours ago there was a new MT5-update, just runned a quick single test, and arrows as well as lines seem to be OK now (but i didn't compare them with the times and prices from the deals-list).

So it might be worth a new try.

 

But i've just seen that i still have another problem with the Tester and Custom Symbols:

In the "Backtest"-tab are no results considered, as if there were no trades opened (see screenshot 1). But the arrows and lines in the chart seem to be OK, as well as the bunch of logged deals in the "Jounal"-tab, here an example of one position with partial close:

2022.01.16 22:19:37.586 Core 01 2020.12.28 01:00:00   order performed buy 0.2 at 126.308 [#3927 buy 0.2 T_EURJPY at 126.308]

2022.01.16 22:19:37.586 Core 01 2020.12.28 01:00:00   CTrade::OrderSend: instant buy 0.20 T_EURJPY at 126.308 sl: 126.104 tp: 129.022 [done at 126.308]

2022.01.16 22:19:37.586 Core 01 2020.12.28 01:00:00   CTradeUtil::Buy: buy success. code=10009,description=done at 126.308

2022.01.16 22:19:37.586 Core 01 2020.12.28 02:15:00   instant sell 0.1 T_EURJPY at 126.458, close #3927 (126.458 / 126.468 / 126.458)

2022.01.16 22:19:37.586 Core 01 2020.12.28 02:15:00   deal #3928 sell 0.1 T_EURJPY at 126.458 done (based on order #3928)

2022.01.16 22:19:37.586 Core 01 2020.12.28 02:15:00   deal performed [#3928 sell 0.1 T_EURJPY at 126.458]

2022.01.16 22:19:37.586 Core 01 2020.12.28 02:15:00   order performed sell 0.1 at 126.458 [#3928 sell 0.1 T_EURJPY at 126.458]

2022.01.16 22:19:37.586 Core 01 2020.12.28 02:15:00   CTrade::OrderSend: instant sell 0.10 position #3927 T_EURJPY at 126.458 [done at 126.458]

2022.01.16 22:19:37.586 Core 01 2020.12.28 02:15:00   position modified [#3927 buy 0.1 T_EURJPY 126.308 sl: 126.349 tp: 129.022]

2022.01.16 22:19:37.586 Core 01 2020.12.28 02:15:00   CTrade::OrderSend: modify position #3927 T_EURJPY (sl: 126.349, tp: 129.022) [done]

2022.01.16 22:19:37.586 Core 01 2020.12.28 05:15:00   instant sell 0.1 T_EURJPY at 126.429, close #3927 (126.429 / 126.438 / 126.429)

2022.01.16 22:19:37.586 Core 01 2020.12.28 05:15:00   deal #3929 sell 0.1 T_EURJPY at 126.429 done (based on order #3929)

2022.01.16 22:19:37.586 Core 01 2020.12.28 05:15:00   deal performed [#3929 sell 0.1 T_EURJPY at 126.429]

2022.01.16 22:19:37.586 Core 01 2020.12.28 05:15:00   order performed sell 0.1 at 126.429 [#3929 sell 0.1 T_EURJPY at 126.429]

2022.01.16 22:19:37.586 Core 01 2020.12.28 05:15:00   CTrade::OrderSend: instant sell 0.10 position #3927 T_EURJPY at 126.429 [done at 126.429]


BUT what i can't believe, is the 100% winrate (but it recognizes 2380 trades in the OnTester):

2022.01.16 22:19:37.586 Core 01 2020.12.30 23:59:59   Winrate: 100.00 (wins: 2380, losses: 0)

2022.01.16 22:19:37.586 Core 01 final balance 10000.00 EUR

2022.01.16 22:19:37.586 Core 01 OnTester result 100


But everything works fine with the provider's data, as the 2nd screenshots show.


Reason: