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,436評論 0 10
  • 今天,跟朋友一起去吃飯,朋友午睡喜歡回床上睡,我中午吃完飯直接回公司,躺兩張椅子拼成的小床,這在我看來雖然犧牲了一...
    像天空的鴿子閱讀 112評論 0 0
  • 不知何時 發現自己的內心有自卑的因子 它不知不覺 折磨著我 上學時一到發言就膽怯 紅著臉磕磕絆絆地結束 私下里暗示...
    一輝而明閱讀 469評論 1 2
  • 因為我爸爸小時候常常因為這件事(即我弟弟想吃一個什么東西)就大打出手發很大的火,他就認為別人吃東西就是怎么了,是一...
    QueenB閱讀 657評論 1 1
  • 上周六完成了9月時間管理的第一步,目標落地。剩下的20天中,要完成的項目有三個,想要養成的習慣有兩個。 那么,今天...
    洛嘉_yang閱讀 199評論 2 0