| stevehopwoodforex.com https://www.stevehopwoodforex.com/phpBB3/ Print view |
|
| Utility Procedures / Code Snippets https://www.stevehopwoodforex.com/phpBB3/viewtopic.php?t=166 |
Page 5 of 7 |
| Author: | snailbeard [ Fri Jul 26, 2013 12:44 pm ] |
| Post subject: | Re: Utility Procedures / Code Snippets |
IKVM.NET http://www.ikvm.net/ Came a cross a tool for creating a DLL from Java jar. The plan is to write all (well 90%) of future code in say Java and or perhaps C# and then produce a DLL. I have not tried this tool yet but it looks interesting and the Java versus c#/.Net depends on what exists in C# and Java already to avoid reinventing the wheel. |
|
| Author: | snailbeard [ Wed Aug 28, 2013 3:27 pm ] |
| Post subject: | Re: Utility Procedures / Code Snippets |
Pesky Alerts Don't want to use the once only option? Some simple functions for having more control over the frequency of some Alerts (if running on a faster time frame such as M1) or if your loop is processed on every tick: (the code is running and nolonger producing an alert every tick - but can't be sure that Alerts will come back again until... ) Code: Select all |
|
| Author: | AnotherBrian [ Wed Aug 28, 2013 5:16 pm ] |
| Post subject: | Re: Utility Procedures / Code Snippets |
For an EA, look at the top and remove the words "extern" - extern means external input from the user. looks like this extern int risk; extern bool useMA; You can set up the values right inside the code and remove the extern - this is called "hard coding" I use it for my EA's that I run so I don't occidentally change anything. I don't like to use set files. |
|
| Author: | atharmian [ Sun Oct 13, 2013 5:15 am ] |
| Post subject: | Re: Utility Procedures / Code Snippets |
babalu4u, Looks very cool for a newbie like me. 1. Will this create additional n buffers if put in a loop , for j= 1...n ? 2. So is #1 then useful in writing MTF indis, where my problem is that if I modify a single TF indi so it creates multiple TF instances in same window, the buffer overwrite causes only the last chart TF to be displayed? The alternative solution I am trying is to use, say, buffer arrUSD modified to arrUSD [i +j*maxBars] where maxBars is the number of displayed bars in any TF. j will be the loop defining TFs. Regards, Athar.
|
|
| Author: | snailbeard [ Tue Nov 12, 2013 10:23 am ] |
| Post subject: | Monitoring spread |
Monitoring spread Several members expressed an interest in the code for monitoring spread. However, it depends on some of my other headers, but here is the core of it. Limitations: It only takes one sample per minute not per tick and at the begiinning of a new minute so there is the possibility of skewed results. It could be improved by having a similar approach for collecting ticks and passing that data along to the minute monitor. Please let other members know how you are approaching your spread monitoring. I am thinking of writing some independent code to record spread and slippage so that we know what the crims are upto when we enter and exit trades. Code: Select all |
|
| Author: | snailbeard [ Sat Nov 16, 2013 7:36 am ] |
| Post subject: | Re: Utility Procedures / Code Snippets |
More on spread monitoring: I should have mentioned that I found and downloaded several indicators for monitoring/logging spread. They are probably a lot more 'fit for purpose' than my quick hack and at some stage I'll see what I can learn from their source code. Here is a short list spread indicators that I download but only briefly looked at: IND_Monitoring-Spread.mq4 Spreadtrack_v2.mq4 |
|
| Author: | 4EverMaAT [ Mon Jun 23, 2014 12:19 pm ] |
| Post subject: | Re: Utility Procedures / Code Snippets |
Can you link to where you downloaded these two from? |
|
| Author: | Radar [ Tue Aug 26, 2014 4:44 am ] |
| Post subject: | Utility Procedures / Code Snippets |
Here's some lazy typists' helpers... If you've read all this thread, you would have come across dietcoke's GlobalVariable shortcut functions here... http://www.stevehopwoodforex.com/phpBB3 ... t=20#p8373 If you're using GV's in an indicator or EA, you have to ensure that multiple instances don't stomp all over each other's GV's. To do this, add the following #defines... Code: Select all Code: Select all As for "cat"... Code: Select all Code: Select all If you plan to run multiple instances on the same symbol and timeframe, just add an underscore to "My_Variable_Name" and add string(MagicNumber) (or any other unique identifier) after that, like so... Code: Select all Have fun! Radar =8^) |
|
| Author: | DigitalCrypto [ Tue Mar 24, 2015 10:42 pm ] |
| Post subject: | Utility Procedures / Code Snippets |
EDIT: I apologize but I didn't know WindowHandle() had a shitty deinit bug that could cause hangups and freezes. I've tried storing MagicNumber as a Global but it still doesn't fix the problem. Just be aware that it is a known bug and could cause a terminal hang. I do apologize for this. If you know a work around to get rid of the hangs when switching charts with the EA loaded, by all means please let me know. Thanks. ========== Newbie to coding for Meta Traitor. Here is a function I hacked together to generate and store magic numbers on disk so I don't have to manually input them all of the time when I restart or move machines. Critiques, rewrites and deletes are welcome. Code: Select all Code: Select all Code: Select all |
|
| Author: | DigitalCrypto [ Sat Apr 18, 2015 11:15 am ] |
| Post subject: | Solarized Color Scheme for Metaeditor |
EDIT: I got the compiler working for Scite editor but I still need to test it in Empty4 when I get to the office. So this post would not be applicable. I will leave it for now until I get the compiler tested. Then I will consolidate the posting. UPDATE: Compiler works for latest builds now. I will write up a post on it. Most coders look at the screen for long periods of time. To reduce eyestrain I applied Ethan Schoonover's Solarized Color palette to Metaeditor. http://ethanschoonover.com/solarized Enjoy! http://i.imgur.com/PXpk6bO.png //--Link to external pic on imgur.com Simply edit c:\Empty4\config\metaeditor.ini or where ever you have it and modify the color section. [Colors] Color0=4339207 Color1=10592659 Color2=16777215 Color3=7695960 Color4=15790320 Color5=13798182 Color8=39301 Color9=10002730 Color10=3093212 Color11=1461195 Note: The font I prefer is DejaVu Sans on sourceforge. http://sourceforge.net/projects/dejavu/ |
|
| All times are UTC | Page 5 of 7 |
|
Powered by phpBB® Forum Software © phpBB Limited |
|