Use Custom Indicator in Strategies

Custom indicators can be used from a strategy just like any other standard JForex platform indicator. In order to use these custom indicators in calculations they must be registered first. There are two ways how one can register a custom indicator within a strategy:

  • register the indicator from a compiled .jfx file;
  • register the indicator from a class which is located within the strategy's java file.

For the former apporach one can also elect to package the indicators in the compiled strategy file, see below the first example for this. As an example of application of both approaches see onStart method of Simple custom indicator.

The following examples demonstrate ways how one can register custom indicators, handle their outputs and plot them on chart.

Package custom indicator in strategy jfx file

In order to package the indicators inside the compiled strategy one has to use the CustomIndicators annotation. This approach allows the user to run the strategy on other workstations without having to copy along the indicator jfx files.

Note: CustomIndicators available with JForex-API 2.7.9.5. IIndicators.getIndicatorByPath available with JForex-API 2.9.1.

©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容

  • rljs by sennchi Timeline of History Part One The Cognitiv...
    sennchi阅读 7,424评论 0 10
  • 今天,跟朋友一起去吃饭,朋友午睡喜欢回床上睡,我中午吃完饭直接回公司,躺两张椅子拼成的小床,这在我看来虽然牺牲了一...
    像天空的鸽子阅读 112评论 0 0
  • 不知何时 发现自己的内心有自卑的因子 它不知不觉 折磨着我 上学时一到发言就胆怯 红着脸磕磕绊绊地结束 私下里暗示...
    一辉而明阅读 469评论 1 2
  • 因为我爸爸小时候常常因为这件事(即我弟弟想吃一个什么东西)就大打出手发很大的火,他就认为别人吃东西就是怎么了,是一...
    QueenB阅读 657评论 1 1
  • 上周六完成了9月时间管理的第一步,目标落地。剩下的20天中,要完成的项目有三个,想要养成的习惯有两个。 那么,今天...
    洛嘉_yang阅读 197评论 2 0