Coding help - page 547

 
popej30:
Show me Mladen two files - firs non decompile - second compile. In my opinion non decompile it is ex4, compile - mq4

popey30

Thanks for the effort to explain to me what is compiled and and what is decompiled file, but :

ex4 file is a compiled file

The you file posted is a decompiled file - a process when the ex4 file is converted from ex4 file back to mt4 file - usually when there is a protection or when the author did not want to post the original source code file and when people think that they are going to gain something by "unlocking the secrets" of the ex4 files

________________

Original source code files (mq4 files too, but the way how the author wrote it, not how the decompiler "reconstructed" it) you can find as much as you want - for example I never posted a single decompiled mq4 file - all the mq4 files I posted are original source code files and you are welcomed to see the difference between those files and the mq4 file that you have posted

________________

PS: I have told it multiple times, but will tell again. It is not a matter if I can change the decompiled mq4 file or not. It is a matter of a choice. And I have chosen not to do to others what I would not like that they do to me. And that is all

all the best

 

Hi mladen

Do you know how one can store DAX prices with timestamp in excel? I have tried using DDE without success. Been going through all pages on FF,here and mql5 without success.

This is the vba code i use in excel for the DDE provided by MT4.

Sub Workbook_Open()

DimwbAsWorkbookDimLinksAsVariantDimiAsLongSetwb=ThisWorkbook Links=wb.LinkSources(xlOLELinks)Fori=LBound(Links)ToUBound(Links)IfLeft$(Links(i),8)="MT4|ASK"Thenwb.SetLinkOnData Links(i),"MT4_OnUpdate"EndIfNextEnd Sub[/CODE]

and

Sub MT4_OnUpdate() ' DDE Updated TIME, copy dataDimwsAsWorksheetDimSourceAsRangeDimDestAsRangeSetws=Worksheets("DAX")WithwsSetSource=ws.Range("A2:E2")SetDest=.Cells(.Rows.Count,1).End(xlUp).Offset(1,0).Resize(1,Source.Columns.Count)EndWithDest.Value=Source.ValueEnd Sub

It won't update on ASK price and every time i open Excel the sheet wont update because the code "='MT4'|ASK!"DE30" changes to "='MT4'|ASK!_xlbgnm.DE30" automatically.

There is a code for MQL but it only stores price in a notepad. I need it live on excel so i can create charts and calculations.

[CODE]// EA code

int file_handle;string InpFileName = _Symbol + ".txt"; // File nameinput string InpDirectoryName = "Data"; // Folder name int OnInit(){ ResetLastError(); file_handle = FileOpen(InpDirectoryName + "//" + InpFileName, FILE_WRITE|FILE_TXT|FILE_ANSI); if(file_handle == INVALID_HANDLE) { PrintFormat("Failed to open %s file, Error code = %d", InpFileName, GetLastError()); ExpertRemove(); } return INIT_SUCCEEDED;} void OnTick(){ // Datetime, Bid, Volume string s = TimeToStr(TimeGMT()) + " " + Bid + " " + Volume[0]; FileWriteString(file_handle, s + "\r\n");} void OnDeinit(const int reason){ FileClose(file_handle); }

I would be nice if you could help me out. Been stuck for 2 weeks trying to fix this.

Thanks in advance

 
drammen:
Hi mladen

Do you know how one can store DAX prices with timestamp in excel? I have tried using DDE without success. Been going through all pages on FF,here and mql5 without success.

This is the vba code i use in excel for the DDE provided by MT4.

Sub Workbook_Open()

DimwbAsWorkbookDimLinksAsVariantDimiAsLongSetwb=ThisWorkbook Links=wb.LinkSources(xlOLELinks)Fori=LBound(Links)ToUBound(Links)IfLeft$(Links(i),8)="MT4|ASK"Thenwb.SetLinkOnData Links(i),"MT4_OnUpdate"EndIfNextEndSub[/CODE]

and

Sub MT4_OnUpdate() ' DDE Updated TIME, copy dataDimwsAsWorksheetDimSourceAsRangeDimDestAsRangeSetws=Worksheets("DAX")WithwsSetSource=ws.Range("A2:E2")SetDest=.Cells(.Rows.Count,1).End(xlUp).Offset(1,0).Resize(1,Source.Columns.Count)EndWithDest.Value=Source.ValueEndSub

It won't update on ASK price and every time i open Excel the sheet wont update because the code "='MT4'|ASK!"DE30" changes to "='MT4'|ASK!_xlbgnm.DE30" automatically.

There is a code for MQL but it only stores price in a notepad. I need it live on excel so i can create charts and calculations.

[CODE]// EA code

int file_handle;string InpFileName = _Symbol + ".txt"; // File nameinput string InpDirectoryName = "Data"; // Folder name int OnInit(){ ResetLastError(); file_handle = FileOpen(InpDirectoryName + "//" + InpFileName, FILE_WRITE|FILE_TXT|FILE_ANSI); if(file_handle == INVALID_HANDLE) { PrintFormat("Failed to open %s file, Error code = %d", InpFileName, GetLastError()); ExpertRemove(); } return INIT_SUCCEEDED;} void OnTick(){ // Datetime, Bid, Volume string s = TimeToStr(TimeGMT()) + " " + Bid + " " + Volume[0]; FileWriteString(file_handle, s + "\r\n");} void OnDeinit(const int reason){ FileClose(file_handle); }

I would be nice if you could help me out. Been stuck for 2 weeks trying to fix this.

Thanks in advance

drammen

Frankly I haven't used metatrader as the source of dynamic data from the excel side so I can not be of any useful assistance to you in this matter.

 

Hi mladen

Thanks for replying back

I understand. Thanks anyway You wouldn't by chance know other solutions?

 

hi,

i\'ve got a quick question.

I have an indicator that checks for certain conditions in the chart to which it is attached too. I follow multiple instruments right now, so i have to add the same indicator to different charts in order to get an alert from all the instruments. I've been thinking to check all the instruments with one indicator that is attached to one chart using a for loop. With each new loop a different instrument is checked for the right conditions. However, what happens when the symbol/instrument to which this all-in-one indicator is attached too doesen't give a tick, or gives ticks much less often then other instruments give that are checked with the loop. Could i theoretically miss alerts? What happens when ticks come so fast that the indicator isen't finished going through all the loops before the next tick arrives?

Kind regards,

 
drammen:
Hi mladen

Thanks for replying back

drammen

I understand. Thanks anyway You wouldn't by chance know other solutions?

drammen

Sorry, but it was so long that I coded some stuff using VBA that we can tell that it is gone with the wind what I knew about it then

 
mrcodix:
hi,

i\'ve got a quick question.

I have an indicator that checks for certain conditions in the chart to which it is attached too. I follow multiple instruments right now, so i have to add the same indicator to different charts in order to get an alert from all the instruments. I've been thinking to check all the instruments with one indicator that is attached to one chart using a for loop. With each new loop a different instrument is checked for the right conditions. However, what happens when the symbol/instrument to which this all-in-one indicator is attached too doesen't give a tick, or gives ticks much less often then other instruments give that are checked with the loop. Could i theoretically miss alerts? What happens when ticks come so fast that the indicator isen't finished going through all the loops before the next tick arrives?

Kind regards,

mrcodix

In new metatrader 4 you have a timer function that does not depend on ticks (not the current chart nor any other chart). So you could use that to have some reasonably fast response for any list of instruments even if they never receive ticks

 

hi mladen and mr.tools and everyone....I need your help....ı have u got a indicator trend lines..but ı need histogram versiyon...please make it histo......thank you very much everyone...

Files:
trend.mq4  2 kb
trend.ex4  9 kb
 
mladen:
mrcodix In new metatrader 4 you have a timer function that does not depend on ticks (not the current chart nor any other chart). So you could use that to have some reasonably fast response for any list of instruments even if they never receive ticks

wow thx allot mladen!

 
mrcodix:
wow thx allot mladen!

Glad that I could help

Happy trading

Reason: