Entrata short dopo un nuovo minimo

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #199847 quote
    Enrico
    Participant
    New

    Buona sera a tutti, desidererei aprire la posizione short dopo il comando (close < indicator1) E SOLO se la candela successiva fa un nuovo minimo.

    Sapete aiutarmi?

    //Definizione dei parametri del codice
    DEFPARAM CumulateOrders = false // Posizioni cumulate disattivate
    // Il sistema cancellerà tutti gli ordini  in attesa e chiuderà tutte le posizioni a 0:00. Dopo l'orario "Flat Before" non saranno piazzati nuovi ordini o posizioni.
    DEFPARAM FLATBEFORE = 153300
    // Cancellere tutti gli ordini in attesa e chiudere tutte le posizioni all'orario "Flat After"
    DEFPARAM FLATAFTER = 180000
    
    // Impedisce al sistema di tradare in giorni specifici della settimana
    daysForbiddenEntry = OpenDayOfWeek  = 6 OR OpenDayOfWeek  = 0
    OTD = (Barindex - TradeIndex(1) > IntradayBarIndex)
    // Condizioni per entrare su posizioni short
    indicator1 = SuperTrend[4,52]
    c1 = (close < indicator1)
    
    IF c1 AND not daysForbiddenEntry and OTD  THEN
    SELLSHORT 10000 CASH AT MARKET
    ENDIF
    
    // Condizioni per uscire da posizioni short
    indicator2 = SuperTrend[4,52]
    c2 = (close CROSSES OVER indicator2)
    
    IF c2 THEN
    EXITSHORT AT MARKET
    ENDIF
    // Stop e target
    SET STOP %LOSS 1
    SET TARGET %PROFIT 0
    

    Grazie in anticipo.

    #199879 quote
    robertogozzi
    Moderator
    Legend

    Ecco:

    //Definizione dei parametri del codice
    DEFPARAM CumulateOrders = false // Posizioni cumulate disattivate
    // Il sistema cancellerà tutti gli ordini  in attesa e chiuderà tutte le posizioni a 0:00. Dopo l'orario "Flat Before" non saranno piazzati nuovi ordini o posizioni.
    DEFPARAM FLATBEFORE = 153300
    // Cancellere tutti gli ordini in attesa e chiudere tutte le posizioni all'orario "Flat After"
    DEFPARAM FLATAFTER = 180000
    
    // Impedisce al sistema di tradare in giorni specifici della settimana
    daysForbiddenEntry = OpenDayOfWeek  = 6 OR OpenDayOfWeek  = 0
    OTD = (Barindex - TradeIndex(1) > IntradayBarIndex)
    // Condizioni per entrare su posizioni short
    indicator1 = SuperTrend[4,52]
    c1 = (close < indicator1)
    c2 = low < low[1]
    
    IF c1[1] AND c2 AND not daysForbiddenEntry and OTD THEN
    SELLSHORT 10000 CASH AT MARKET
    ENDIF
    
    // Condizioni per uscire da posizioni short
    indicator2 = SuperTrend[4,52]
    c2 = (close CROSSES OVER indicator2)
    
    IF c2 THEN
    EXITSHORT AT MARKET
    ENDIF
    // Stop e target
    SET STOP %LOSS 1
    SET TARGET %PROFIT 0
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

Entrata short dopo un nuovo minimo


ProOrder: Trading Automatico & Backtesting

New Reply
Author
author-avatar
Enrico @ocirne Participant
Summary

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

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