- Search Forex Factory
- 27 Results
- MehZhure replied Jun 24, 2015
Ah ha! I finally figured it out. So, here is what I did. C#/Ninjascript code: namespace NinjaTrader.Indicator { public class TestIndicator : Indicator { [StructLayout(LayoutKind.Sequential)] public struct TestStruct { public int x, y; } static ...
- MehZhure replied Jun 24, 2015
I have been thinking on this a while, and if I understand correctly, what I should actually be doing is... Pass the relevant structs, containing the necessary data, to the C++ dll. Declare the new struct array on the C++ side. Populate the new ...
- MehZhure replied Jun 23, 2015
True! My problem is, C++ and C# are still fairly new to me, and all of the data is calculated at once, instead of one element at a time. So I need to set the function up so I can dump a huge amount of data across at once. This is, of course, based ...
- MehZhure replied Jun 23, 2015
Woohoo! Success! Thank you for the help, broketrader! Now, I am going to have to study this and see if I can figure out how to apply it to a 100,000 element struct array.
- MehZhure replied Jun 23, 2015
Nope. I tried it and got the following error message.
- MehZhure replied Jun 23, 2015
That is the sets of code as per my last attempt. And, if you would like to test it, NinjaTrader is free to demo.
- MehZhure replied Jun 23, 2015
Whoops! I hit the post button before I was finished. Here is the C# code. namespace NinjaTrader.Indicator { public class TestIndicator : Indicator { [StructLayout(LayoutKind.Sequential)] public struct TestStruct { public int x, y; } TestStruct[] ...
- MehZhure replied Jun 23, 2015
Absolutely! First, my C++ code. #define WIN32_LEAN_AND_MEAN #include "stdafx.h" #include <windows.h> #include <stdlib.h> #include <stdio.h> BOOL APIENTRY DllMain(HMODULE hModule, DWORD ul_reason_for_call, LPVOID lpReserved ) { switch ...
- MehZhure replied Jun 23, 2015
Hello again broketrader! I have run into another big snag. Only this time...it is in NinjaTrader....which is to say, it is basically C# (in case you are not familiar with the NinjaTrader platform). So, since I last posted, I have succeeded in ...
- MehZhure replied Jun 18, 2015
I finally figured out what the issue was. So, when you create a new dll project in VS2013, it creates a dllmain.cpp file with the main function in it. I don't like this extra file hanging around, so I prefer to copy the main function over to my ...
- MehZhure replied Jun 18, 2015
In case this gives you an idea of what might be causing the issue..... I just added the necessary structs, class, and function to my previous SampleDLLtest solution, and compiled it. Then, after copying the new SampleDLLtest to the mql4/library ...
- MehZhure replied Jun 18, 2015
I added the extern declaration in your example as such... extern "C" MT4_EXPFUNC bool __stdcall LiveChart(const BarTrack &bars, Stars &points, Patterns *gartleys, Patterns *bats, Patterns *butterflies, Patterns *cyphers, const BarData *rates, Basics ...
- MehZhure replied Jun 18, 2015
Hey ya broketrader! Since you have been busy helping mindy with her expert, I had posted a question about an issue over on stackoverflow. It seems nobody over there has any ideas. Granted, this is a very odd situation. Basically, I have finished my ...
- MehZhure replied Jun 9, 2015
This is just a quick follow-up on the issue I was having with passing a string to a dll. I had an idea occur to me from reading the code you had suggested, broketrader. To keep the explanation short, I ended up using a char[] to store my string. It ...
- MehZhure replied Jun 9, 2015
Just a thought, it may help if you posted an annotated chart, showing an actual trade setup, etc.
- MehZhure replied Jun 9, 2015
Thank you for the help, broketrader! I will work with this code and see if I can get it to function as I am needing. On the topic of the mql4 doc info....I somehow missed the part about not being able to pass structures that contain strings. The odd ...
- MehZhure replied Jun 9, 2015
Time for me to take you up on the offer to help if I have any code issues. I know the answer is probably really obvious, but it has eluded me thus far. So, first....I have been able to successfully pass and modify structures with numbers, even ...
- MehZhure replied Jun 8, 2015
In case anyone is interested in doing the flow charts, here is a link to some good flow chart software. It is a paid product, but they have a free license for single users. url Anyway, just thought I would share that in case someone was looking ...
- MehZhure replied Jun 7, 2015
I can honestly say, had I understood all this info on OOP-style programming, the last several projects I have worked on would have been much easier. And probably easier to debug.
- MehZhure replied Jun 7, 2015
I may take you up on that offer in the coming weeks. In case you are interested, what I am actually preparing to do is take a 3000-lines-of-code indicator I have streamlined in MT4 (using the OOP concepts I learned here), and move everything ...