|
|
 |

09-23-2009, 04:18 PM
|
|
Member
|
|
Join Date: Apr 2009
Posts: 53
|
|
Example: Using Order2Go with Indicore (BETA)
Hello Everybody,
I'm posting a example that i wrote, which uses both Indicore and Order2Go together using C#.
This sample application is still in beta stage, but it can still help to illustrate how Indicore can be used with Order2Go.
For now this application only uses 1 indicator at the time.
Here is the list of operations that are performed by this application:
(HISTORY)
1. Get Price History from Order2Go
2. Build Bar Source from Price History
3. Apply specified Indicator to our Bar Source
4. Print that Bar Source along with Indicator output(s) to the screen
(LIVE RATE UPDATE)
5. Listen for incoming Ticks and process them (Basically continue building our bar source from incoming ticks)
- Look if tick belongs to current bar, its done by looking up beginning of current tick's period
- If it does, check incoming tick to see for new "high" and "low", and update the "close"
- If tick belongs to the NEW bar, create a new bar and add it as latest bar to our Bar Source
- When new bar is added to the Bar Source, previous bar which is already complete is printed on the screen along with indicator output(s).
Most operations are performed by "Order2GoCommunicator.cs" and it creates and stores all references to objects of "IndicatorProcessor.cs" and "PeriodCalculator.cs" and just calls them to perform certain operations.
MainApp.cs just creates instance of Order2GoCommunicator and puts application into infinite loop and waiting for Events.
RUNNING THE EXAMPLE IN YOUR CONSOLE:
When you compile the example code and run it in your console please MAKE SURE that your console width in characters in NO LESS than 150.
When you open windows console ("cmd") click your mouse in top left corner and open "Properties". In "Layout" tab you can change size of the console window. "Window Size" set Width to 150, that should be enough to display this example's output.
Dont Forget to add references to the proper .dll's when you try to compile, also dont forget to have latest Order2Go installed, 'cause thats what i used when writing this example.
If you have any questions please reply to this thread, and i'll answer then to the best of my ability.
Last edited by fexxxer; 09-23-2009 at 04:58 PM..
|

09-23-2009, 05:24 PM
|
|
Member
|
|
Join Date: Apr 2009
Posts: 53
|
|
|
Also sample output!
I also thought that it would be good to post sample application output, so you can see what you supposed to get from running this example.
This output was recorded today, running Ichimoku with 1 minute period. So as you see from the output (look at attached file), every minute we get a printout of a new bar with indicator outputs. (5 outputs, since Ichimoku has many outputs unlike MVA, which has has only 1)
|

09-28-2009, 08:52 AM
|
|
Registered User
|
|
Join Date: Mar 2009
Posts: 2
|
|
|
If i need volume for one indicator....
How can i receive volume, to calculate indicator EW for example.
Thanks,
Dan
|

09-28-2009, 03:06 PM
|
|
Member
|
|
Join Date: Apr 2009
Posts: 53
|
|
Quote:
Originally Posted by pirvu
How can i receive volume, to calculate indicator EW for example.
Thanks,
Dan
|
Dear pirvu,
For now FXCM does not support Volumes unfortunately. The method .GetPriceHistory() only can return High,Low,Open,Close for both Bid and Ask prices and that's it.
That is the reason its not used in the example i posted.
I'm very sorry, maybe they will develop this functionality in the future.
Let me know if you have any other questions.
Best Regards,
Fexxxer
|

10-27-2009, 07:03 AM
|
|
Registered User
|
|
Join Date: Oct 2009
Posts: 3
|
|
|
Fexxer, this was EXACTLY what I needed for my personal app. Thank you for the major help... you saved me a headache or three!
Rob
|

10-27-2009, 10:14 AM
|
|
Member
|
|
Join Date: Apr 2009
Posts: 53
|
|
Quote:
Originally Posted by Chimera
Fexxer, this was EXACTLY what I needed for my personal app. Thank you for the major help... you saved me a headache or three!
Rob
|
Glad to help  If you have any questions let me know. This app is far from perfect, but it does demonstrate how to use both APIs together.
|

10-30-2009, 10:03 AM
|
|
Registered User
|
|
Join Date: Oct 2009
Posts: 3
|
|
|
apologies - i just looked at the samples. Question answered!
|

11-06-2009, 05:31 PM
|
|
Registered User
|
|
Join Date: Oct 2009
Posts: 3
|
|
|
Fexxer, I've installed C# on a laptop and used the latest production release (06192008.exe) of Order2Go but I keep getting COM registration errors when instantiating the core objects. I thought this was the same version I have on my desktop (where my objects work fine), but just to make sure, when you say "latest" Order2Go, do you mean the production release, or the most recent beta of 073109 ?
Thanks a million
Rob
|

11-06-2009, 05:56 PM
|
|
Member
|
|
Join Date: Apr 2009
Posts: 53
|
|
Quote:
Originally Posted by Chimera
Fexxer, I've installed C# on a laptop and used the latest production release (06192008.exe) of Order2Go but I keep getting COM registration errors when instantiating the core objects. I thought this was the same version I have on my desktop (where my objects work fine), but just to make sure, when you say "latest" Order2Go, do you mean the production release, or the most recent beta of 073109 ?
Thanks a million
Rob
|
I meant latest production release. Can you post the error that you are getting and the source code part that throws it? I'm leaving the office soon, but i'll take loot at it (if you post it) first thing Monday.
It weird, cause creation of FXCore should not be problematic no matter what version you have running. Lets see if we can figure it out.
|
 |
| Thread Tools |
|
|
| Rate This Thread |
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|