Incremento posizione rispetto a trade precedente

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #183153 quote
    elfuego77elfuego77
    Participant
    Junior

    Salve a tutti, chiedo supporto in questo.

    Vorrei dire al sistema se il trade precedente è andato bene incrementa di 1 se invece è andato male decrementa di 1.

    Dunque il problema è come fare per recuperare il dato dell’ultima operazione.

    Grazie per il supporto!

    #183182 quote
    robertogozzirobertogozzi
    Moderator
    Legend

    Eccolo:

    Once Lotti  = 1
    Once Minimo = 1
    If StrategyProfit > StrategyProfit[1] then
       Lotti = Lotti + 1
    ElsIf StrategyProfit < StrategyProfit[1] then
       Lotti = max(Minimo,Lotti - 1)
    Endif

    non permette di scendere sotto il minimo indicato (che non deve essere minore di quello richiesto dal broker).

    #185932 quote
    elfuego77elfuego77
    Participant
    Junior

    Ciao Roberto, su backtest funziona a meraviglia. In real però funziona solo se è nella stessa seduta. Se si passa al giorno dopo il sistema non tiene memoria del passato. Come si può risolvere? Forse inserendo la stringa come un multitime frame? Cioè mettendo Timeframe daily e poi le condizioni operative?

    #185944 quote
    robertogozzirobertogozzi
    Moderator
    Legend

    Deve funzionare in ambedue i casi, perché dovrebbero azzerarsi i dati del giorno precedente, se nessuno li azzera di proprosito?

    #185947 quote
    elfuego77elfuego77
    Participant
    Junior

    Ah! Questo non lo so. Ti ho riportato quanto accaduto in reale e quanto proveniente da back test.

    #185949 quote
    robertogozzirobertogozzi
    Moderator
    Legend

    Se posti il codice completo posso provarlo.

    #186006 quote
    elfuego77elfuego77
    Participant
    Junior

    Eccolo. Ricapitolando con backtest esegue l’operazione di incremento se la volta prima l’operazione è andata male, in real non lo fa.

    2-minuti-ST-07.01.2021-sito.itf
    #186043 quote
    robertogozzirobertogozzi
    Moderator
    Legend

    Vedo solo il backtest, che funziona.

    In autotrading probabilmente gli hai dato un numero di contratti insufficiente. Indica 999 (mi pare sia il massimo, eventualmente verifica con PRT).

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

Incremento posizione rispetto a trade precedente


ProOrder: Trading Automatico & Backtesting

New Reply
Author
author-avatar
elfuego77 @elfuego77 Participant
Summary

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

Topic Details
Forum: ProOrder: Trading Automatico & Backtesting
Language: Italian
Started: 12/11/2021
Status: Active
Attachments: 1 files
ProRealCode ProRealCode
Loading...