MT4: What for are the (header) MQH files - questions

 

I have some questions about MQH files in Meta Trader 4. I 'v never used files like that in MQL4 programming and I would like to know:

1/. What for are the MQH files? What can I obtain using this files?

2/. Is it possible to import the external DLL library into MQH file and next include this MQH file into my EA in order to use the functions implemented on DLL (imported to included MQH file)?

3/. Where the MQH files should be saved in order to use them in EA code?

 
puncher:

I have some questions about MQH files in Meta Trader 4. I 'v never used files like that in MQL4 programming and I would like to know:

1/. What for are the MQH files? What can I obtain using this files?

2/. Is it possible to import the external DLL library into MQH file and next include this MQH file into my EA in order to use the functions implemented on DLL (imported to included MQH file)?

3/. Where the MQH files should be saved in order to use them in EA code?

i c u want an answer so badly, so i will do my best (AFAIK)


1) lats say for example u r writing an EA & instead of writing in every EA the function OrderSend() & check what size to open the trade according your account equity or & check if IsTradeAllowed(), IsTradeContextBusy(), RefreshRates() & so on, u r writing the whole code in an MQH file & any time u need u just call this function from there

2) yes

3) MetaTraderFolder\experts\include\

 
qjol:

i c u want an answer so badly, so i will do my best (AFAIK)


1) lats say for example u r writing an EA & instead of writing in every EA the function OrderSend() & check what size to open the trade according your account equity or & check if IsTradeAllowed(), IsTradeContextBusy(), RefreshRates() & so on, u r writing the whole code in an MQH file & any time u need u just call this function from there

2) yes

3) MetaTraderFolder\experts\include\


many thanks I will check it...
 
qjol:

i c u want an answer so badly, so i will do my best (AFAIK)


1) lats say for example u r writing an EA & instead of writing in every EA the function OrderSend() & check what size to open the trade according your account equity or & check if IsTradeAllowed(), IsTradeContextBusy(), RefreshRates() & so on, u r writing the whole code in an MQH file & any time u need u just call this function from there

2) yes

3) MetaTraderFolder\experts\include\

Nice answer qjol,

just one more detail about this, for the .ex4 file, it makes no difference at all if I code all in my .mq4 file or if I code part in the .mq4 file and the other part in the .mqh file, right? I mean, I don't have to put the .mqh file in the include directory? I remember that if I want to use a custom indicator, I have to have it in the right folder.

Reason: