Annullare un ordine Limit se la condizione di ingresso cambia

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #85311 quote
    GIBU2GIBU2
    Participant
    Average

    Buongiorno a tutti vorrei aanullare l’ordine Limit che viene inserito
    se la condizione cambia ma non riesco farlo : qualcuno puo aiutarmi grazie.

    // Definizione dei parametri del codice
    DEFPARAM CumulateOrders = FALSE // Posizioni cumulate disattivate
    
    KO = 10
    IF OnMarket THEN
    PrezzoEntrata = 0
    NumeroBarra   = 0
    Rialzo        = 0
    Ribasso       = 0
    ENDIF
    
    IF Not OnMarket AND ((BarIndex - NumeroBarra) <= 8) THEN
    IF Rialzo THEN
    BUY 1 CONTRACT AT PrezzoEntrata - KO * pipsize LIMIT       //oppure STOP
    ELSIF Ribasso THEN
    SELLSHORT 1 CONTRACT AT PrezzoEntrata + KO * pipsize LIMIT //oppure STOP
    ENDIF
    ENDIF
    
    // Condizioni per entrare su posizioni long
    indicator1 = SuperTrend[4.4,3]
    c1 = (close CROSSES OVER indicator1)
    
    IF c1 THEN
    BUY 1 CONTRACT AT close - KO * pipsize LIMIT // INGRESSO LONG CON ORDINE LIMIT NON A MERCATO( VALORE VARIABILE PRIMA DEL ASTERISCO )
    ENDIF
    
    // CONDIZIONI PER TENERE APERTO L'ORDINE LIMT PER 10 BARRE
    IF c1 AND Not OnMarket THEN
    PrezzoEntrata = CLOSE
    NumeroBarra   = BARINDEX
    BUY 1 CONTRACT AT PrezzoEntrata - KO * pipsize LIMIT
    Rialzo  = 1
    Ribasso = 0
    ENDIF
    
    // Condizioni per uscire da posizioni long
    indicator2 = SuperTrend[9,6]
    c2 = (close CROSSES UNDER indicator2)
    
    IF c2 THEN
    SELL AT MARKET
    ENDIF
    
    // CONDIZIONE PER PORTARE LO STOP LOSS IN PROFITTO DI 5 PIPS UNA VOLTA RAGGIUNTO IL LIVELLO DI 10 PIPS IN PROFITTO VERSIONE LONG
    IF NOT ONMARKET THEN
    newSL=0
    ELSIF LONGONMARKET AND close-tradeprice(1)>=10*pipsize THEN
    newSL = tradeprice(1)+5*pipsize
    ENDIF
    IF newSL>0 THEN
    SELL AT newSL STOP
    ENDIF
    
    // Stop e target
    SET STOP pLOSS 8
    SET TARGET pPROFIT 132
    
    #85313 quote
    NicolasNicolas
    Keymaster
    Legend

    Non è possibile annullare un ordine in sospeso. Scadono automaticamente dopo 1 candelabro.

    #85355 quote
    GIBU2GIBU2
    Participant
    Average

    Ok cercherò altri modi grazie.

    #85365 quote
    robertogozzirobertogozzi
    Moderator
    Legend

    Ok cercherò altri modi grazie.

    L’unico modo alternativo è di usare il recente supporto MTF (Multiple Time Frames), ancora in beta test sui conti demo ma che sarà rialsciato ufficialmente a breve, ed usare un TF basso per la sola entrata a mercato quando le condizioni sono valide. Ad esempio, se lavori su un TF a 1 ora o 15 minuti, potresti usare come default (TF principale) quallo a 10 secondi, ed entrare a mercato invece che con ordini pendenti.

    #85376 quote
    GIBU2GIBU2
    Participant
    Average

    Farò delle prove nei prossimi giorni 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

Annullare un ordine Limit se la condizione di ingresso cambia


ProOrder: Trading Automatico & Backtesting

New Reply
Author
author-avatar
GIBU2 @gibu2 Participant
Summary

This topic contains 4 replies,
has 3 voices, and was last updated by GIBU2GIBU2
7 years, 10 months ago.

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