Go Back   DailyFX Forum > FXCM Products and Services > FXProgrammers > Discussion / Support Forum > Order2Go COM Trading API Support

Reply
 
Thread Tools Rate Thread
  #1 (permalink)  
Old 09-23-2009, 04:18 PM
Member
 
Join Date: Apr 2009
Posts: 53
fexxxer is an unknown quantity at this point
Exclamation 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.
Attached Files
File Type: zip Indicore Application Example v.1 - BETA.zip (11.3 KB, 57 views)

Last edited by fexxxer; 09-23-2009 at 04:58 PM..
Reply With Quote
  #2 (permalink)  
Old 09-23-2009, 05:24 PM
Member
 
Join Date: Apr 2009
Posts: 53
fexxxer is an unknown quantity at this point
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)
Attached Files
File Type: txt Example Application Output.txt (52.9 KB, 66 views)
Reply With Quote
  #3 (permalink)  
Old 09-28-2009, 08:52 AM
Registered User
 
Join Date: Mar 2009
Posts: 2
pirvu is an unknown quantity at this point
Send a message via Yahoo to pirvu
If i need volume for one indicator....

How can i receive volume, to calculate indicator EW for example.
Thanks,
Dan
Reply With Quote
  #4 (permalink)  
Old 09-28-2009, 03:06 PM
Member
 
Join Date: Apr 2009
Posts: 53
fexxxer is an unknown quantity at this point
Quote:
Originally Posted by pirvu View Post
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
Reply With Quote
  #5 (permalink)  
Old 10-27-2009, 07:03 AM
Registered User
 
Join Date: Oct 2009
Posts: 3
Chimera is an unknown quantity at this point
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
Reply With Quote
  #6 (permalink)  
Old 10-27-2009, 10:14 AM
Member
 
Join Date: Apr 2009
Posts: 53
fexxxer is an unknown quantity at this point
Quote:
Originally Posted by Chimera View Post
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.
Reply With Quote
  #7 (permalink)  
Old 10-30-2009, 10:03 AM
Registered User
 
Join Date: Oct 2009
Posts: 3
Chimera is an unknown quantity at this point
apologies - i just looked at the samples. Question answered!
Reply With Quote
  #8 (permalink)  
Old 11-06-2009, 05:31 PM
Registered User
 
Join Date: Oct 2009
Posts: 3
Chimera is an unknown quantity at this point
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
Reply With Quote
  #9 (permalink)  
Old 11-06-2009, 05:56 PM
Member
 
Join Date: Apr 2009
Posts: 53
fexxxer is an unknown quantity at this point
Quote:
Originally Posted by Chimera View Post
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.
Reply With Quote
Reply

Tags
indicore

Thread Tools
Rate This Thread
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

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off




Disclaimer: Trading foreign exchange on margin carries a high level of risk, and may not be suitable for all investors. The high degree of leverage can work against you as well as for you. Before deciding to trade foreign exchange you should carefully consider your investment objectives, level of experience, and risk appetite. The possibility exists that you could sustain a loss of some or all of your initial investment and therefore you should not invest money that you cannot afford to lose. You should be aware of all the risks associated with foreign exchange trading, and seek advice from an independent financial advisor if you have any doubts. Any opinions, news, research, analyses, prices, or other information contained on this website is provided as general market commentary and does not constitute investment advice. Forex Capital Markets LLC. will not accept liability for any loss or damage, including without limitation to, any loss of profit, which may arise directly or indirectly from use of or reliance on such information.

All times are GMT -5. The time now is 11:43 AM.
Copyright ©2009 Daily FX. All Rights Reserved.