Return number from indicator

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #179456 quote
    umebon
    Participant
    Average

    Hi

    Is it possible to return a value (ex: 1.3) from an indicator to a system and how do I code that?

    #179460 quote
    robertogozzi
    Moderator
    Master

    This is a one-line indicator that does the job:

    RETURN 1.3

    You need to use CALL to get the returned value from it:

    ReturnedValue = CALL "MyIndicator"

    you don’t need to write any parameter since it doesn’t expect any, as it only returns one value.

    #179461 quote
    umebon
    Participant
    Average

    Tnx, if I have multiple numbers, how do I write that?

    #179487 quote
    robertogozzi
    Moderator
    Master

    Indicator

    RETURN 1.3,20,5

    Strategy:

    X,y,z = CALL "MyIndicator"

    If you strategy doesn’t need all the three returned values, it may use the keyword IGNORED for those unwanted:

    X,ignored,z = CALL "MyIndicator"
    umebon thanked this post
Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.

Return number from indicator


ProOrder: Automated Strategies & Backtesting

New Reply
Author
author-avatar
umebon @umebon Participant
Summary

This topic contains 3 replies,
has 2 voices, and was last updated by robertogozzi
4 years, 4 months ago.

Topic Details
Forum: ProOrder: Automated Strategies & Backtesting
Language: English
Started: 10/12/2021
Status: Active
Attachments: No files
Logo Logo
Loading...