contatore di candele

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #193271 quote
    emanuele81
    Participant
    Senior

    Buonasera,

    avrei bisogno di un contatore di candele long e short,

    deve individuare l’ultima candela long oppure short di un periodo, da poter inserire poi in una strategia,

    come posso scrivere il codice.

    Grazie

    #193298 quote
    robertogozzi
    Moderator
    Master

    Ecco:

    Once Nlong  = 0
    Once Nshort = 0
    If close > open then
       Nlong = Nlong + 1
    Endif
    If close < open then
       Nshort = Nshort + 1
    Endif

    Nlong e Nshort conterranno, rispettivamente, il numero di candele Long e Short fino a quel momento.

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

contatore di candele


ProOrder: Trading Automatico & Backtesting

New Reply
Author
author-avatar
emanuele81 @emanuele81 Participant
Summary

This topic contains 1 reply,
has 2 voices, and was last updated by robertogozzi
3 years, 9 months ago.

Topic Details
Forum: ProOrder: Trading Automatico & Backtesting
Language: Italian
Started: 05/16/2022
Status: Active
Attachments: No files
Logo Logo
Loading...