Improve calculating time of own indicator

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #40044 quote
    Fabian
    Participant
    New

    Hi,

    i have a own indicator. Its based on the Donchian Channel.

    In programming a own indicator i cant choose the Donchian Channel indicator. Therefore i create my own DC indicator:

    PointHigh = HIGHEST[n] (HIGH)
    PointLow = LOWEST[n](LOW)
    
    Return PointHigh AS "HIGH", PointLow AS "LOW"

    Here is my own indicator, but the calculating time is very bad…i wrote a java program to calculate my indicator its much more faster. Therefore i think i make a mistake in prorealtime?

    myHIGH, myLOW = CALL "DC Own"[perioden]
    
    result = 0
    resultIndikator = 0
    
    FOR i = 0 TO perioden DO
    IF myHigh[i] > myHigh[i+1] THEN
    result = result + 1
    ENDIF
    IF myLow[i] < myLow[i+1] THEN
    result = result + 1
    ENDIF
    NEXT
    
    IF result > mindestWert THEN
    resultIndikator = 1
    ELSE
    resultIndikator = -1
    ENDIF
    
    return resultIndikator

    Has anyone a idea to improve the calculating time?

    Thanks!

    #40093 quote
    JC_Bywan
    Moderator
    Master

    Hi,

    We are all expecting fairly soon a new engine allowing “call” to be much faster than its current snail pace. In the meantime whenever possible avoiding “call”, by copying and pasting the called code in the calling code, will go a long way to improve speed (worth having a look at pages 23-24-25, especially p25, of following manual with some examples)  https://www.prorealtime.com/en/pdf/probacktest_c1491462069c.pdf

    Nicolas thanked this post
    #40121 quote
    Nicolas
    Keymaster
    Master

    You can also increase speed of your program replacing this kind of FOR/NEXT loop by using SUMMATION of boolean variables results.

Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.

Improve calculating time of own indicator


ProBuilder: Indicators & Custom Tools

New Reply
Author
author-avatar
Fabian @fabian Participant
Summary

This topic contains 2 replies,
has 3 voices, and was last updated by Nicolas
8 years, 7 months ago.

Topic Details
Forum: ProBuilder: Indicators & Custom Tools
Language: English
Started: 07/07/2017
Status: Active
Attachments: No files
Logo Logo
Loading...