Multiple Symbols
Multiple Symbols
13 Jul 2015, 21:15
Hey there!
I'm quite new to C++, so I thought I would seek some help here.
Is there a way to use more than just one symbol's closing price for a calculation?
For example, how would you code this in cAlgo?
(EURUSD(close) + USDJPY(close)) / GBPUSD(close)
Thanks for the help in advance.
Replies
Makagon
13 Jul 2015, 23:25
Ok, it's easy, use this:
var eurusd = MarketData.GetSeries("EURUSD", TimeFrame.Daily);
var usdjpy = MarketData.GetSeries("USDJPY", TimeFrame.Daily);
var gbpusd= MarketData.GetSeries("GBPUSD", TimeFrame.Daily);
next...
(eurusd.Close(LastResult)+usdjpy .Close(LastResult))/gbpusd.Close(LastResult)
@Makagon
Spotware
14 Jul 2015, 11:02
Dear Trader,
You can use the Timeframe without selecting one of the supported timeframe values.It will return you the timeframe used in the current instance.
The following code snippet illustrates it.
TimeFrame time = TimeFrame; Print(time.ToString());
We hope this helps you.
Please note that we do not provide coding assistance services. We more than glad to assist you with specific questions about cAlgo.API. You also can contact one of our Partners or post a job in Development Jobs section for any coding assistance.
@Spotware
Spotware
14 Jul 2015, 11:43
RE:
BBalazs said:
Okay, I'm sorry if I broke any rules. Is there a site or book you would recommend to learn the basics of programming in C++ / cAlgo?
Dear BBalazs,
Please take a look at API Programmer's Guides, to our API Reference section and at this thread: /forum/cbot-support/5688?page=1#5
@Spotware
Makagon
13 Jul 2015, 22:58
+
@Makagon