compra alla barre X e vendi alla barra Y

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #108704 quote
    GuidozGuidoz
    Participant
    New

    Scusate: perché questo semplice codice, che dovrebbe lavorare come da titolo, non funziona? Grazie

    IF BarIndex = 5 THEN
    BUY 1 shares AT MARKET
    ENDIF
    
    If BarIndex = 10 THEN
    SELL AT MARKET
    ENDIF
    #108706 quote
    robertogozzirobertogozzi
    Moderator
    Legend

    Aggiungendo

    GRAPH BarIndex

    puoi monitorare, candela dopo candela, il valore di BarIndex (o variabili, senza limiti, almeno sul demo). Dalla foto Y vedrai che la prima barra ha BarIndex = 1000 perché ProOrder ne carica un pò di default.

    Se vuoi che non ne carichi devi indicare come prima riga:

    DEFPARAM PreLoadBars = 0

    in tal modo parte da 1 e, come puoi vedere dalla foto X, funziona correttamente (la 5 è la barra di setup, tu vedrai la freccia d’entrata sotto la barra 6 perché le strategie vengono sempre eseguite alla chiusura della barra, appena prima che la nuova si apra).

    y-10.jpg y-10.jpg x-19.jpg x-19.jpg
    #109764 quote
    GuidozGuidoz
    Participant
    New

    Grazie, gentilissimo funziona!

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

compra alla barre X e vendi alla barra Y


ProOrder: Trading Automatico & Backtesting

New Reply
Author
author-avatar
Guidoz @guidoz Participant
Summary

This topic contains 2 replies,
has 2 voices, and was last updated by GuidozGuidoz
6 years, 12 months ago.

Topic Details
Forum: ProOrder: Trading Automatico & Backtesting
Language: Italian
Started: 09/27/2019
Status: Active
Attachments: 2 files
ProRealCode ProRealCode
Loading...