Problema take profit ingresso

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #100502 quote
    ciro
    Participant
    New
    // Condizioni per entrare su posizioni long
    
    c1 = (close  > open [120])
    c3 = (close[121] > open[240])
    c11 = (close  > open)
    IF c1 AND c3 and c11 and timeEnterAfter THEN
    BUY 1.6 CONTRACT AT MARKET
    p = 16
    ENDIF
    
    // Condizioni per entrare su posizioni short
    c2 = (close < open [120])
    c4 = (close[121] < open[240])
    c22 = (close < open)
    IF c2 AND c4 and c22 and timeEnterAfter THEN
    SELLSHORT 1.6 CONTRACT AT MARKET
    p = 16
    ENDIF
    
    c111 = (close > open)
    IF not ONMARKET and c111 AND timeEnterAfter   THEN
    BUY 1.6 CONTRACT AT MARKET
    p = 8.2
    ENDIF
    
    // Condizioni per entrare su posizioni short
    c222 = (close < open)
    
    IF not ONMARKET and c222 AND timeEnterAfter  THEN
    SELLSHORT 1.6 CONTRACT AT MARKET
    p = 8.2
    ENDIF
    
    // Stop e target
    SET TARGET pPROFIT p

    Il programma usa SEMPRE come take profit 8.2 invece che 16 anche quando entra il contratto con take 16

    #100505 quote
    robertogozzi
    Moderator
    Master

    Perché le righe 20 e 27 sono, una o l’altra, sempre vere quindi p=8.2, anche se prima gli era stato assegnato un valore diverso.

    ciro thanked this post
    #100565 quote
    ciro
    Participant
    New

    ma la condizione “not onmarket” non è sempre vera.

    Comunque, come posso scriverlo correttamente?

    grazie

    #100567 quote
    robertogozzi
    Moderator
    Master

    Comunque aggiungendo queste righe alla fine:

    graph c11
    graph c22
    graph c111
    graph c222
    graph p
    graph OnMarket

    puoi verificare i valori delle variabili che t’interessano, candela per candela, nella finestra delle variabili di ProBackTest (è una finestra presente quando si usa GRAPH, se non lo usi la finestra non appare).

    GRAPH e GRAPHONPRICE aiutano molto a trovare errori.

    x-8.jpg x-8.jpg
    #100570 quote
    robertogozzi
    Moderator
    Master

    Usa sempre la condizione Not OnMarket per entrare in posizione, così sei certo che lo SL non ti cambia, altrimenti te lo può cambiare anche quando sei a mercato:

    // Condizioni per entrare su posizioni long
     
    c1 = (close  > open [120])
    c3 = (close[121] > open[240])
    c11 = (close  > open)
    IF c1 AND c3 and c11 AND Not OnMarket then//and timeEnterAfter THEN
    BUY 1.6 CONTRACT AT MARKET
    p = 16
    ENDIF
     
    // Condizioni per entrare su posizioni short
    c2 = (close < open [120])
    c4 = (close[121] < open[240])
    c22 = (close < open)
    IF c2 AND c4 and c22 AND Not OnMarket then //and timeEnterAfter THEN
    SELLSHORT 1.6 CONTRACT AT MARKET
    p = 16
    ENDIF
     
    c111 = (close > open)
    IF not ONMARKET and c111 then//AND timeEnterAfter   THEN
    BUY 1.6 CONTRACT AT MARKET
    p = 8.2
    ENDIF
     
    // Condizioni per entrare su posizioni short
    c222 = (close < open)
     
    IF not ONMARKET and c222 then//AND timeEnterAfter  THEN
    SELLSHORT 1.6 CONTRACT AT MARKET
    p = 8.2
    ENDIF
     
    // Stop e target
    SET TARGET pPROFIT p
    graph c11
    graph c22
    graph c111
    graph c222
    graph p
    graph OnMarket

    ho commentato una variabile inesistente.

    Ti conviene mettere, come riga iniziale:

    DEFPARAM CumulateOrders = false
Viewing 5 posts - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.

Problema take profit ingresso


ProBuilder: Indicatori & Strumenti Personalizzati

New Reply
Author
author-avatar
ciro @ciro Participant
Summary

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

Topic Details
Forum: ProBuilder: Indicatori & Strumenti Personalizzati
Language: Italian
Started: 06/12/2019
Status: Active
Attachments: 1 files
Logo Logo
Loading...