TSI Strategy Automation

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #106921 quote
    RiaanvNRiaanvN
    Participant
    Average

    Hello,

    I require assistance please? I have basic strategy which I wish to automate but unfortunately the True Strength Indicator is “not available in ProBuilder language”. I have been using the the following code obtained from a previous forum:

    a = (ExponentialAverage[13](ExponentialAverage[25](ROC[1](close))))
    b = (ExponentialAverage[13](ExponentialAverage[25](ABS(ROC[1](close)))))
    
    TSI = 100 * (a/b)

    Please will you assist with code for TSI(1) and TSI(2)?

    This is my strategy:

    a = (ExponentialAverage[13](ExponentialAverage[25](ROC[1](close))))
    b = (ExponentialAverage[13](ExponentialAverage[25](ABS(ROC[1](close)))))
    
    TSI = 100 * (a/b)
    
    // Conditions to enter long positions
    c1 = TSI < -20
    c2 = TSI > TSI(1) and TSI(1)>TSI(2)
    
    IF c1 and c2 THEN
    BUY 1 lot AT MARKET
    ENDIF

    Thanks

    #106927 quote
    robertogozzirobertogozzi
    Moderator
    Legend

    > For clarity of messages on ProRealCode’s forums, please use the “insert code PRT” button to separate the text of the code part! Thank you! <<

    At line 8 replace parenthesis with brackets to get  TSI[1] & TSI[2].

    RiaanvN thanked this post
    #106929 quote
    RiaanvNRiaanvN
    Participant
    Average

    Ai, silly me. Thanks Roberto.

    #127524 quote
    BulleBulle
    Participant
    New

    Hello, i am wondering how do we write a[1] in this exemple?

    Is it this?

    a[1] = (ExponentialAverage[13](ExponentialAverage[25](ROC[1](close))))[1]
    #127526 quote
    VonasiVonasi
    Moderator
    Master

    Please use the ‘Insert PRT Code’ button when putting any code in your posts.

    a = (ExponentialAverage[13](ExponentialAverage[25](ROC[1](close))))

    defines what the value of ‘a’ is for every bar.

    a[1] on its own will just return the value for ‘a’ one bar back from the last bar on the chart.

    #127527 quote
    BulleBulle
    Participant
    New

    Thanks for your answer so a[1] should be this right?

    a = (ExponentialAverage[13](ExponentialAverage[25](ROC[1](close))))
    
    a[1] =  (ExponentialAverage[13](ExponentialAverage[25](ROC[1](close[1]))))
    
    

    Thanks for your answer so a[1] should be this right?

    I ask this because i want to find the close X such as

    (ExponentialAverage[13](ExponentialAverage[25](ROC[1](close[1]))))-(ExponentialAverage[13](ExponentialAverage[25](ROC[1](X))))=0
    

    Do you have a way to calculate that X?

    #127532 quote
    robertogozzirobertogozzi
    Moderator
    Legend

    You cannot assign a value to a past event.

    a[1] is the result of an assignment occurred the previous candle and is read-only.

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

Stuck on this ProBuilder code?

Describe what this topic is trying to build, in plain English, and ProRealAI writes the ProRealTime™ indicator, screener or system for you.

Available in 7 languages
Try ProRealAI

TSI Strategy Automation


ProOrder: Automated Strategies & Backtesting

New Reply
Author
author-avatar
RiaanvN @riaanvn Participant
Summary

This topic contains 6 replies,
has 4 voices, and was last updated by robertogozzirobertogozzi
6 years, 5 months ago.

Topic Details
Forum: ProOrder: Automated Strategies & Backtesting
Language: English
Started: 09/09/2019
Status: Active
Attachments: No files
ProRealCode ProRealCode
Loading...