Problema con lowest e entrata

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #253656 quote
    Tommaso._r0maTommaso._r0ma
    Participant
    New

    Salve, ho un problema con un sistema sullo Spot gold (E1) timeframe h4.

    Le condizioni c5 e c55 dovrebbero far si che il sistema entri solo se l’high[0] è maggiore dell’high più alto delle ultime 3 candele (per il long), e se il low[0] è minore del low più basso delle ultime 3 candele (per lo short).

    Per quanto riguarda l’entrata dovrebbe entrare long sul low[0] e entrare short sull’high[0].

    Ecco il codice intero

     

    defparam cumulateorders=false
    smaC=average[11] (close)
    smaH=average[12] (high)
    smaL=average[12] (low)
    x1=abs(close-open)<(close/100)*0.067
    x2=abs(close-open)>(close/100)*0.025
    x22=abs(close[1]-open[1])>(close[1]/100)*0.02
    //long
    c=close[0]<open[0]
    c0=close>smaL
    c1=open<smaH
    c3=close[1]<smaH
    c4=open[1]>smaL
    c5=high>highest[3]
    c6=high[1]>smaC
    c7=high>smaC
    //short
    cc=close[0]>open[0]
    c00=open>smaL
    c11=close<smaH
    c33=open[1]<smaH
    c44=close[1]>smaL
    c55=low<lowest[3]
    c66=low[1]<smaC
    c77=low<smaC

    exit=barindex-tradeindex=8
    // Condizioni per entrare su posizioni long
    IF c and c0 and c1 and c3 and c4 and c5 and c6 and c7 and x1 and x2 and x22 THEN
    BUY 1 CONTRACTS AT low+0*pointsize stop
    ENDIF

    // Condizioni per uscire da posizioni long
    If LongOnMarket AND exit THEN
    SELL AT MARKET
    ENDIF

    // Condizioni per entrare su posizioni short
    IF cc and c00 and c11 and c33 and c44 and c55 and c66 and c77 and x1 and x2 and x22 THEN
    SELLSHORT 1 CONTRACTS AT high-0*pointsize stop
    ENDIF

    // Condizioni per uscire da posizioni short
    IF ShortOnMarket AND exit THEN
    EXITSHORT AT MARKET
    ENDIF

    // Stop e target: Inserisci qui i tuoi stop di protezione e profit target
    set stop %loss 1.37
    set target %profit 2.88

    #253665 quote
    GraHalGraHal
    Participant
    Master

    Essayez ci-dessous

    c5=haut>plushaut[3](haut[1])

    c55=bas<bas[3](bas[1])

    robertogozzi and Iván González thanked this post
    #253666 quote
    GraHalGraHal
    Participant
    Master

    Ooops, i Mod di Apols sono quelli sopra, per favore cancellateli.

    Provate qui sotto…

    c5=alto>più alto[3](alto[1])

    c55=basso<minimo[3](basso[1])

    robertogozzi thanked this post
    #253681 quote
    JSJS
    Participant
    Master

    Hi,

    Il motivo per cui le tue posizioni non vengono aperte esattamente sul “High” o sul “Low” è dovuto all’utilizzo degli ordini “Stop”…

    È meglio utilizzare ordini “Limit”…

    (Si usa un ordine “Stop” quando il “target” si trova sopra il prezzo attuale, e si usano ordini “Limit” quando il “target” si trova sotto il prezzo attuale)

    robertogozzi and Iván González thanked this post
    #253682 quote
    Tommaso._r0maTommaso._r0ma
    Participant
    New

    Ora funziona grazie mille

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

Problema con lowest e entrata


ProOrder: Trading Automatico & Backtesting

New Reply
Author
Summary

This topic contains 4 replies,
has 3 voices, and was last updated by Tommaso._r0maTommaso._r0ma
10 months, 1 week ago.

Topic Details
Forum: ProOrder: Trading Automatico & Backtesting
Language: Italian
Started: 11/15/2025
Status: Active
Attachments: No files
ProRealCode ProRealCode
Loading...