please explain this line of code with summation instruction

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #162722 quote
    nonetheless
    Participant
    Master

    I came across this in someone else’s strategy and, apart from it being an exit code, I don’t entirely understand what it’s doing.

    Most grateful for an explanation in plain language.

    IF LONGONMARKET AND summation[35](close < close[6]) = 35 THEN
    SELL AT MARKET
    ENDIF
    #162723 quote
    JC_Bywan
    Moderator
    Master

    Hi,

    It checks to be true that close was lower than close[6] during each of the last 35 occurences, it saves you from writing the much longer equivalent condition “close<close[6] and close[1]<close[7] and close[2]<close[8] and … and close[34]<close[40]”

    nonetheless thanked this post
    #162724 quote
    nonetheless
    Participant
    Master

    Alright, so it’s basically defining the length of a down trend and at what point it will quit.

    Could be useful, thanks for the explanation.

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

please explain this line of code with summation instruction


ProOrder: Automated Strategies & Backtesting

New Reply
Author
Summary

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

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