Websocket how? - page 12 1...5678910111213141516171819...27 New comment Fedor Arkhipov 2020.04.06 15:56 #111 here Vladimir Suslov 2020.04.06 16:04 #112 Igor Makanu: tried your example, it didn't work. Either my VS settings are wrong or there is something wrong with it. attach the VS project and sample call from MQL5 - it's the right thing to do. ZS: if memory serves me correctly, it stopped working when MQL5 added namespace attached Files: Test_StructMQL.zip 3 kb Fedor Arkhipov 2020.04.06 16:04 #113 Great! Alexei, can you recommend a book for learning sharpe? Fedor Arkhipov 2020.04.06 16:08 #114 Алексей Барбашин: The result is in the studio! Don't forget to include screenshots of the final result. Did you enjoy programming in Sharp? Yes. The main thing is that you can connect it to MQL Fedor Arkhipov 2020.04.06 16:09 #115 I'm sorry, I have to be gone for 30 minutes. Vladimir Suslov 2020.04.06 16:31 #116 Алексей Барбашин: Vladimir, can you tell me how to get data as a structure from Sharp? C# public static void RefTicks(double open, double close, ref StructTicks ddd) { ddd.Open = open; ddd.Close = close; } MQL int OnInit() { StructTicks tick; ConnectorMQL::RefTicks(1.11 ,1.12, tick); Print(tick.Open + " / " + tick.Close); return(INIT_SUCCEEDED); } Igor Makanu 2020.04.06 16:39 #117 Vladimir Suslov:pinned Thank you! strange, your example worked the first time Created a new project in my place from scratch - copied those 5 lines of code and it works again, ok, I'll believe in magic Thanks again! [ARCHIVE!] Any rookie question, Running more than one My approach. The core Fedor Arkhipov 2020.04.06 16:58 #118 I'm here. Igor Makanu 2020.04.06 17:00 #119 Still something's wrong, in theory this code should work. C# using System; using System.Runtime.InteropServices; namespace ClassLibrary2 { [StructLayout(LayoutKind.Sequential, Pack = 1)] public struct MqlTick { public Int64 Time; public Double Bid; public Double Ask; public Double Last; public UInt64 Volume; } public class tst { public static void CopyTick(ref MqlTick inTick, ref MqlTick outTick) { outTick = inTick; } } } MQL5 #import "ClassLibrary2.dll" #import //+------------------------------------------------------------------+ int OnInit() { MqlTick t1,t2; tst::CopyTick(t1,t1); return(INIT_SUCCEEDED); } I get compile errors, that t1 parameter cannot be converted Fedor Arkhipov 2020.04.06 17:04 #120 Алексей Барбашин: Shall we continue? 1...5678910111213141516171819...27 New comment
here
tried your example, it didn't work.
Either my VS settings are wrong or there is something wrong with it.
attach the VS project and sample call from MQL5 - it's the right thing to do.
ZS: if memory serves me correctly, it stopped working when MQL5 added namespace
attached
Great!
Alexei, can you recommend a book for learning sharpe?
The result is in the studio! Don't forget to include screenshots of the final result.
Did you enjoy programming in Sharp?
Yes. The main thing is that you can connect it to MQL
Vladimir, can you tell me how to get data as a structure from Sharp?
C#
MQL
pinned
Thank you!
strange, your example worked the first time
Created a new project in my place from scratch - copied those 5 lines of code and it works again, ok, I'll believe in magic
Thanks again!
Still something's wrong, in theory this code should work.
C#
MQL5
I get compile errors, that t1 parameter cannot be converted
Shall we continue?