interruzuione strategia su base mensile

Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #210520 quote
    romanelli4romanelli4
    Participant
    Average

    buongiorno,

    ho una strategia intraday che vorrei interrompere se all’interno del mese corrente perdo più 200 punti (ad operazioni chiuse) e riattivarla il mese successivo

    è possibile?

    Grazie mille a chi mi sa rispondere

    Max

    #210522 quote
    robertogozzirobertogozzi
    Moderator
    Legend

    Eccolo:

    ONCE TradeOK    = 1
    ONCE myStrategy = 0
    IF OpenMonth <> OpenMonth[1] THEN
       TradeOK    = 1
       myStrategy = StrategyProfit
    ENDIF
    Pips = (StrategyProfit - myStrategy) / PipValue
    IF Pips <= -200 THEN
       TradeOK = 0
    ENDIF
    IF Not OnMarket AND TradeOK AND close CROSSES OVER average[20,0](close) THEN
       BUY 1 Contract at market
       SET STOP   pLOSS   100
       SET TARGET pPROFIT 200
    ENDIF
    //graph TradeOK coloured("Red")
    //graph Pips
    #210535 quote
    romanelli4romanelli4
    Participant
    Average

    grazie mille anche per la velocità

    max

    #210545 quote
    romanelli4romanelli4
    Participant
    Average

    Salve,

    come posso applicare lo stesso ragionamento a livello settimanale?

    basta sostituire openmonth con opendayofweek?

    perchè cosi non mi funziona

    grazie

    max

    #210548 quote
    robertogozzirobertogozzi
    Moderator
    Legend

    Non esattamente, perché così cambierebbe ogni giorno.

    Per determinare quando inizia una nuova settimana devi scrivere la riga 3 così:

    IF OpenDayOfWeek < OpenDayOfWeek[1] THEN
    #210549 quote
    romanelli4romanelli4
    Participant
    Average

    Grazie ,

    ci capisco sempre poco….

    quindi per lo short dovrei scrivere alla riga 3

    IF OpenDayOfWeek > OpenDayOfWeek[1] THEN

    giusto?

    #210563 quote
    robertogozzirobertogozzi
    Moderator
    Legend

    No, la settimana inizia sempre con un giorno minore del vernerdì, che sia di Domenica o Lunedì. I giorni partono da 0 con la domenica e terminano il venerdì con 5 (se ci fosse anche il sabato sarebbe 6). Quindi una nuova settimana è quando il goorno della settimana è < di quello della barra precedente.

    #210567 quote
    romanelli4romanelli4
    Participant
    Average

    è chiaro adesso

    ma perchè sul mensile scrivi <>?

    #210568 quote
    robertogozzirobertogozzi
    Moderator
    Legend

    Perché i mesi sono sempre diversi.

    Mentre i giorni cambiano ogni giorno della settimana.

    #210570 quote
    romanelli4romanelli4
    Participant
    Average

    grazie

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

interruzuione strategia su base mensile


ProOrder: Trading Automatico & Backtesting

New Reply
Author
author-avatar
romanelli4 @romanelli4 Participant
Summary

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

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