Chart Handle?

 

Hello everyone.

I am trying to limit my EA such that it is the only active EA in MT4 terminal.

I have successfully gotten all chart handles but I can't find a way to read the ExpertName for that chart only. 

I found a post from 2011 but the codes are unfortunately outdated and do not work.

Can you help please?

What can I do with the chart handle?

 
Your topic has been moved to the section: MQL4 and MetaTrader 4
Please consider which section is most appropriate — https://www.mql5.com/en/forum/172166/page6#comment_49114893
 
Chioma Obunadike: I am trying to limit my EA such that it is the only active EA in MT4 terminal.
  1. Why do you care?
         How To Ask Questions The Smart Way. (2004)
              Be precise and informative about your problem
              The XY Problem

    Restricting it solves nothing. A User can simply install another terminal and connect to the same account.

  2. Just write it to use the magic number and ignore all other orders.

    Magic number only allows an EA to identify its trades from all others. Using OrdersTotal/OrdersHistoryTotal (MT4) or PositionsTotal (MT5), directly and/or no Magic number/symbol filtering on your OrderSelect / Position select loop means your code is incompatible with every EA (including itself on other charts and manual trading.)
              Symbol Doesn't equal Ordersymbol when another currency is added to another seperate chart . - MQL4 programming forum (2013)
              PositionClose is not working - MQL5 programming forum (2020)
              MagicNumber: "Magic" Identifier of the Order - MQL4 Articles (2006)
              Orders, Positions and Deals in MetaTrader 5 - MQL5 Articles (2011)
              Limit one open buy/sell position at a time - General - MQL5 programming forum (2022)

    You need one Magic Number for each symbol/timeframe/strategy.
         Trade current timeframe, one strategy, and filter by symbol requires one MN.
         If trading multiple timeframes, and filter by symbol requires use a range of MN (base plus timeframe).
              Why are MT5 ENUM_TIMEFRAMES strange? - General - MQL5 programming forum - Page 2 #11 (2020)

 
William Roeder #:
  1. Why do you care?
         How To Ask Questions The Smart Way. (2004)
              Be precise and informative about your problem
              The XY Problem

  2. Just write it to use the magic number and ignore all other orders.

    Magic number only allows an EA to identify its trades from all others. Using OrdersTotal/OrdersHistoryTotal (MT4) or PositionsTotal (MT5), directly and/or no Magic number/symbol filtering on your OrderSelect / Position select loop means your code is incompatible with every EA (including itself on other charts and manual trading.)
              Symbol Doesn't equal Ordersymbol when another currency is added to another seperate chart . - MQL4 programming forum (2013)
              PositionClose is not working - MQL5 programming forum (2020)
              MagicNumber: "Magic" Identifier of the Order - MQL4 Articles (2006)
              Orders, Positions and Deals in MetaTrader 5 - MQL5 Articles (2011)
              Limit one open buy/sell position at a time - General - MQL5 programming forum (2022)

    You need one Magic Number for each symbol/timeframe/strategy.
         Trade current timeframe, one strategy, and filter by symbol requires one MN.
         If trading multiple timeframes, and filter by symbol requires use a range of MN (base plus timeframe).
              Why are MT5 ENUM_TIMEFRAMES strange? - General - MQL5 programming forum - Page 2 #11 (2020)

What you have replied has no relevance to my question. Moderators should have it deleted 
 
Chioma Obunadike #: What you have replied has no relevance to my question. Moderators should have it deleted 

You are unnecessarily trying to do the impossible. Definitely relevant to you.

 
William Roeder #:

You are unnecessarily trying to do the impossible. Definitely relevant to you.

Great! It’s impossible! Good to know! 
Simple and straightforward answer. 
Maybe you should learn how to answer questions the smart way
 
Chioma Obunadike:

Hello everyone.

I am trying to limit my EA such that it is the only active EA in MT4 terminal.

I have successfully gotten all chart handles but I can't find a way to read the ExpertName for that chart only. 

I found a post from 2011 but the codes are unfortunately outdated and do not work.

Can you help please?

What can I do with the chart handle?


you can use fuction ChartSaveTemplate , then read it to get Expert Name.

if you want limit your EA attach only one to chart, then try make EA open one file ( no share read ). other EA can not read it.

 
Trinh Dat #:


you can use fuction ChartSaveTemplate , then read it to get Expert Name.

if you want limit your EA attach only one to chart, then try make EA open one file ( no share read ). other EA can not read it.

thank you very much  Trinh Dat

 
Trinh Dat #: you can use fuction ChartSaveTemplate , then read it to get Expert Name.

Save template saves in the Template folder. File functions read from the Files folder. Now you have different problem.