Attesa evento dopo evento avvenuto

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #29850 quote
    mistral74mistral74
    Participant
    New

    Buongiorno.

    Vorrei creare un trading system che apra un trade short quando il prezzo buca la banda di bollinger superiore a 200 periodi ed a condizione avvenuta, attenda che l’indicatore supertrend diventi superiore al prezzo.

    Ovviamente con un IF THEN riesco a creare le condizioni contemporaneamente ma non riesco a fare in modo che la verifica del supertrend si abbia solo quando la prima è gia positiva (anche se diverse candele prima).

    Ho provato con un ciclo WHILE ma con scarsi risultati. Qualcuno può aiutarmi?

    Grazie 1000

    #29936 quote
    NicolasNicolas
    Keymaster
    Legend

    Quindi, se riprendo la query: in primo luogo si desidera che un candela a perforare le bande di Bollinger inferiore (200 periodi) e poi vuole la SuperTrend a diventare rosso per entrare in una posizione SELL?

    #29938 quote
    mistral74mistral74
    Participant
    New

    per posizione sell – prezzo perfora la banda superiore e si attende che il supertrend diventi rosso per inviare l’ordine. Tante grazie

    #30095 quote
    NicolasNicolas
    Keymaster
    Legend

    Questo frammento di codice dovrebbe fare il trucco per il lato SELLSHORT della strategia:

    p = 10
    
    piercing = summation[10](close crosses over bollingerup[200])>0
    
    st = supertrend[3,10]
    
    if piercing and close crosses under st then 
     sellshort 1 contract at market 
    endif 

    in questo esempio di codice, se guardiamo la chiusura ha attraversato la banda superiore di Bollinger negli ultimi 10 periodi (è possibile modificarlo con p = periodi XX) e poi prendiamo un ordine SELLSHORT se la SuperTrend andare rosso.

Viewing 4 posts - 1 through 4 (of 4 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

Attesa evento dopo evento avvenuto


ProOrder: Trading Automatico & Backtesting

New Reply
Author
author-avatar
mistral74 @mistral74 Participant
Summary

This topic contains 3 replies,
has 2 voices, and was last updated by NicolasNicolas
9 years, 6 months ago.

Topic Details
Forum: ProOrder: Trading Automatico & Backtesting
Language: Italian
Started: 03/25/2017
Status: Active
Attachments: No files
ProRealCode ProRealCode
Loading...