Now Strategies API available not only for Borland Delphi but for Microsoft Visual C++ also. Below you can find attached API files with examples and documentation.
Hi Terranin,
what is the latest C++ API header file: IndicatorInterfaceUnit.h? I found some version inside: http://forextester.ru/forum/download.php?id=19 have you released formal Indicator API??
pion wrote:Hi Terranin, what is the latest C++ API header file: IndicatorInterfaceUnit.h? I found some version inside: http://forextester.ru/forum/download.php?id=19 have you released formal Indicator API??
Thanks
No, it was an old effort to translate indicators' API. It is not ready yet.
Can this API be used to create plain indicators, too? I know a little C, so I think it might be easier for me than learning Delphi, which is based on Pascal.
If so, where might I find instructions and examples for writing indicators in C?
Tantalus wrote:Can this API be used to create plain indicators, too? I know a little C, so I think it might be easier for me than learning Delphi, which is based on Pascal.
If so, where might I find instructions and examples for writing indicators in C?
Will similar code be released in C++ for these indicators? Do you have any sample C++ indicators I could use to model mine? I'm specifically looking to create a Momentum-ZL which is a relatively small change to the basic Momentum indicator.
patronus wrote:Will similar code be released in C++ for these indicators? Do you have any sample C++ indicators I could use to model mine? I'm specifically looking to create a Momentum-ZL which is a relatively small change to the basic Momentum indicator.
Any help would be appreciated.
Thanks...
There is already API available for C++, you can find it after installation in ForexTester\Examples\ folder. There is one strategy example and one indicator (Ishimoku) example.
Hello Mike and others,
can you anyone provide me some simple strategy written by C++ API, which I can use to learn how to write my own ideas When I viewed the headers, function prototypes and definitions (StrategyInterfaceUnit) it apperar as very similar to MQL, with that I wrote (and live running) some strategies. But, the MQL and Metatrader has limitations which is bad for me (no Multipair trades on one EA), total absention of constants and structures (when I need function return more than one variable, what I can do? (other than wrote some structure and this return?).
So, if you have some usable and "learnable how it works" strategy, can you email (or PM) me its code?? (I using in entry decision CCI, Envelopes and EMA, if the code would contains how use this, i will be great)
Last question: Can I mount the DLL to metatrader's EA and run it at live account? If is possibe, how to do? (I'm going to definitively leave the MQL, if it is possible, this will be great way)
The Market can stay irrational longer than you can stay solvent
Terranin wrote: There is already API available for C++, you can find it after installation in ForexTester\Examples\ folder. There is one strategy example and one indicator (Ishimoku) example.
In quoted directory I have not anything usable, only headers which contains definitions and prototypes, an one .CPP file which tells some about object create/set/modify/delete routines. If I had example, I'll not ask you for it, of course Indicator example (ichomuko kinko hyo I have, but this is useless for me )
The Market can stay irrational longer than you can stay solvent
So, I had success with coding "extern" variables and similar stuff, as explained in the "programming lessons" In addition, I was understood how to use send/modify/delete orders, is wrote in similar analogy as MQL. But, and with it I cannot solve: How I can use the Time functions? (is sufficient "relative", so as in MQL Hour(), Minute() and Second() - I drive enter to position in the "entry if" as if( condition && condition &&.......&& Minute() ==0 && BARS != Bars) where assigment BARS=Bars is called when OrderSend(...) returns non-zero integer (ticket num) -so entry condition remains on Minute() ==0 - how I can write it by FT C++ API??
Another question: How I may use built-in indicators, as is CCI, RSI, MA, Stoch, and so on?? In MQL analogy, they I call as iCCI(Currency, TF, Period, UsedPriceToCalculation, shift). Any ideas and/or solutions?
The Market can stay irrational longer than you can stay solvent
frank_horrigan wrote:So, I had success with coding "extern" variables and similar stuff, as explained in the "programming lessons" In addition, I was understood how to use send/modify/delete orders, is wrote in similar analogy as MQL. But, and with it I cannot solve: How I can use the Time functions? (is sufficient "relative", so as in MQL Hour(), Minute() and Second() - I drive enter to position in the "entry if" as if( condition && condition &&.......&& Minute() ==0 && BARS != Bars) where assigment BARS=Bars is called when OrderSend(...) returns non-zero integer (ticket num) -so entry condition remains on Minute() ==0 - how I can write it by FT C++ API?? Another question: How I may use built-in indicators, as is CCI, RSI, MA, Stoch, and so on?? In MQL analogy, they I call as iCCI(Currency, TF, Period, UsedPriceToCalculation, shift). Any ideas and/or solutions?
with that functions you can convert time to C++ format and then use standard C++ functions to get seconds/minutes/hours from this time.
To use any indicator that you can see in Forex Tester you need to create it first in ResetStrategy procedure and get handle of it (this will put it on the chart). Then you can use this handle to get values. See Strategies help file -> Access to indicators, functions CreateIndicator and GetIndicatorValue.
Parameters that you send to the CreateIndicator should be absolutely the same as you can see in its properties dialog window and in the same order (excluding buffer styles). So, for Moving Average it will be next call for example:
second parameter is number of bar, third parameter is number of buffer (if you have more then one in this indicator, for example bollinger bands has 3 buffers for 3 lines)
Thanks for advise, Mike, everything what I need now runs (or I have a way how write it But, your sample code as qouted above is mystificating, the good writing is as follows
Thanks for advise, Mike, everything what I need now runs (or I have a way how write it But, your sample code as qouted above is mystificating, the good writing is as follows
because new parameter was added for VShift. That's why you should check parameters of indicator in dialog window first. There is a trick, if you pass invalid parameters indicator will be still created but with default parameters and you will get a record in Journal about that. It can raise some problems later, if you strategy creates indicators - instead of reusing existing indicator on each start it will create new one, and you will get lots of indicators that will slow your testing.
Terranin wrote:because new parameter was added for VShift
Ok, I will get it for my mind, but it runs me without this additional parameter. Do I some mistake? (I had some problems with OrderCloseTime() and order handling variable, it is reason for I didnt reply soon - solved (I expected that if order is triggered and live, OrderCloseTime() returns zero, as in MT, but it isnt true, and I need to find other way [ I plan use the DLL as EA for MT, orderstotal() is non-effective for mine] VShift I undestrand asi vertical offset, similar to what is using envelopes, is it true? (I have very old version of FT, build 9) But, it is great tool for testing, I like it more and more If could be as replacement for MT, i would like to change it for this
The Market can stay irrational longer than you can stay solvent
Terranin wrote: instead of reusing existing indicator on each start it will create new one, and you will get lots of indicators that will slow your testing.
Yes, my next question: Is any way to force the existing indicators, when I stop testing, destruct themselves WHEN i start NEW test (not when I stop the test) - sorry for my repeated representations of MT and MQL, but I don't know anything else ATS developing language - the MT creates new testing window always when new test was stopped and begin new one, which one instance of indicators
The Market can stay irrational longer than you can stay solvent