Problem with calling an indicator

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

    Playing around with indicator and calling too system but i doesn’t work. I know that I can build in the system but I am building a bigger indicator and want too make it work this way.

    Whats wrong..?

    Indicator named “Example”

    // Indicators for the system
    MA = Average[30](close) // Simple moving average
    cond1 = close > MA AND close > Supertrend[3,10] // Conditions for long positions
    cond2 = close < MA AND close < Supertrend[3,10] // Conditions for short positions
    
    RETURN cond1 AS "cond1", cond2 AS "cond2"

    System:

    CALL "Example"
    
    X = 1 // Number of contracts
    
    IF (cond1) THEN
    BUY X CONTRACTS AT MARKET
    ENDIF
    
    IF LONGONMARKET AND (cond2) THEN
    SELL AT MARKET
    ENDIF
    
    // Short positions
    IF (cond2) THEN
    SELLSHORT X CONTRACTS AT MARKET
    ENDIF
    
    IF SHORTONMARKET AND cond1 THEN
    EXITSHORT AT MARKET
    ENDIF
    
    // Stops and targets : Enter your protection stops and profit targets here
    SET STOP pTrailing 5 // Backtest StopLoss if contracts increases
    #154559 quote
    umebon
    Participant
    Average

    I solved it myself… noobie mistake

    #154563 quote
    Vonasi
    Moderator
    Master

    umebon – Glad to hear that you solved your own problem but please follow the forum rules with any future topics and give your topic a meaningful title. I have changed your topic title. 🙂

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

Problem with calling an indicator


ProBuilder: Indicators & Custom Tools

New Reply
Author
author-avatar
umebon @umebon Participant
Summary

This topic contains 2 replies,
has 2 voices, and was last updated by Vonasi
5 years, 1 month ago.

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