Condizione prezzo sempre sopra la media a 200 per le ultime n candele

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #140002 quote
    EdisoneEdisone
    Participant
    Average

    Salve, in questo semplice bcacktest basato sul SuperTrend non riesco a porre come prima condizione necessaria che il prezzo SIA sempre sopra la media a 200 per le ultime 10 candele. Grazie

    DEFPARAM CumulateOrders=False
    
    indicator1 = close
    indicator2 = SuperTrend[3,10]
    c1 = (indicator1 >= indicator2)
    
    n = 10
    indicator4 = Average[200](close)
    c2 = summation[n](indicator4 > indicator4[1]) = n
    
    
    IF c1 and c2 THEN
    BUY 1 SHARES AT MARKET
    ENDIF
    
    
    indicator3 = close
    indicator4 = SuperTrend[3,10]
    c2 = (indicator3 <= indicator4)
    
    IF c2 THEN
    SELL  AT MARKET
    ENDIF
    #140007 quote
    robertogozzirobertogozzi
    Moderator
    Legend

    Alla riga 9 non verifichi che il prezzo (CLOSE) sia sopra la media, ma che la media sia maggiore della precedente candela.

    Sostituisci la riga 9 con questa:

    c2 = summation[n](close > indicator4) = n
Viewing 2 posts - 1 through 2 (of 2 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

Condizione prezzo sempre sopra la media a 200 per le ultime n candele


ProOrder: Trading Automatico & Backtesting

New Reply
Author
author-avatar
Edisone @edisone Participant
Summary

This topic contains 1 reply,
has 2 voices, and was last updated by robertogozzirobertogozzi
6 years, 2 months ago.

Topic Details
Forum: ProOrder: Trading Automatico & Backtesting
Language: Italian
Started: 07/23/2020
Status: Active
Attachments: No files
ProRealCode ProRealCode
Loading...