Aiuto su Ts

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #62978 quote
    traderwintraderwin
    Participant
    Average

    Salve, mi servirebbe aiuto sulla costruzione di un ts.
    Il ts mi deve inserire un ordine long buy 5 pip sopra il massimo della giornata precedente e un ordine sell 5 pip sotto il minimo del giorno precedente.
    Se ad esmpio nella giornata di ieri il prezzo ha come max 10000 e come minimo 9000, il ts oggi mi dovra’ inserire un ordine long a 10005 e un ordine short a 8995. Lo stop loss, va settato a a 30 punti e la posizione verra’ seguita in trailing stop. chi mi puo’ aiutare??
    Grazie anticipatamente.

    #62983 quote
    robertogozzirobertogozzi
    Moderator
    Legend

    Su TF giornaliero?

    #62984 quote
    traderwintraderwin
    Participant
    Average

    Ciao Roberto. Il timeframe è m15 o m5

    #62990 quote
    robertogozzirobertogozzi
    Moderator
    Legend

    Ho buttato giù questo codice, provalo e fammi sapere.

    Così comìè scritto fa anche più di un’operazione al giorno; se ne vuoi fare solo una devi togliere i commenti dalle 3 righe che ho interamente commentato.

    Buon fine settimana.

    DEFPARAM CumulateOrders = false
    ONCE PrezzoMassimo = 0
    ONCE PrezzoMinimo  = 0
    IF IntradayBarIndex = 0 THEN
       PrezzoMassimo = 0
       PrezzoMinimo  = 0
    ENDIF
    //IF OnMarket THEN                                 //queste righe commentate servono per non fare
    //   PrezzoMassimo = 999999                        //una seconda operazione dopo la prima, se invece vuoi
    //ENDIF                                            //farle lasciale così (o toglile)
    IF PrezzoMassimo = 0 THEN
       PrezzoMassimo = Dhigh(1) + (5 * pipsize)
    ENDIF
    IF PrezzoMinimo  = 0 THEN
       PrezzoMinimo  = Dlow(1)  - (5 * pipsize)
    ENDIF
    IF PrezzoMassimo <> 999999 AND Not OnMarket THEN
       IF close < PrezzoMassimo THEN
          BUY 1 CONTRACTS AT PrezzoMassimo STOP
       ELSE
          BUY 1 CONTRACTS AT PrezzoMassimo LIMIT
       ENDIF
       SET STOP pTRAILING 30
    ENDIF
    IF PrezzoMinimo <> -1 AND Not OnMarket THEN
       IF close > PrezzoMinimo THEN
          SELLSHORT 1 CONTRACTS AT PrezzoMinimo STOP
       ELSE
          SELLSHORT 1 CONTRACTS AT PrezzoMinimo LIMIT
       ENDIF
       SET STOP pTRAILING 10
    ENDIF
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

Aiuto su Ts


ProOrder: Trading Automatico & Backtesting

New Reply
Author
author-avatar
traderwin @traderwin Participant
Summary

This topic contains 3 replies,
has 2 voices, and was last updated by robertogozzirobertogozzi
8 years, 7 months ago.

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