trading di lunedi

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #195236 quote
    pitp222pitp222
    Participant
    New

    Buonasera a tutti,ho fatto un semplice programmino impostando un acquisto il lunedi e vendendo il martedi,sotto il programma,solo che quando lancio il backetesting non viene effettuto nessun acquisto.

    Non riesco a capire il motivo,visto che l’istruzione Dayofweek=1 corrisponde al lunedi,= 2 al martedi e cosi via,oppure c’è qualcosa che non capisco.

    Un grazie a tutti in anticipo.

    Buona serata

    Pierangelo.

    Sotto il programma

     

    set stop %Loss 3
    if Dayofweek=1 and not Longonmarket then
    Buy 1000 Cash At Market
    endif
    if Longonmarket and Dayofweek=2 Then
    Sell at Market
    endif

    MauroPro thanked this post
    #195238 quote
    MauroProMauroPro
    Participant
    Veteran

    Da me questo funziona, vende il martedi.

    defParam cumulateOrders = false

    if close crosses over average[50,0](close) and not longOnMarket and dayOfWeek = 1 then
    buy 1 contract at market
    endif

    if longOnMArket and dayOfWeek = 2 then
    sell 1 contract at Market
    endif

    set stop %Loss 3

    #195239 quote
    MauroProMauroPro
    Participant
    Veteran

    Se vuoi puoi anche indicare un ora precisa quando uscire il martedi:

    defParam cumulateOrders = false

    if close crosses over average[50,0](close) and not longOnMarket and dayOfWeek = 1 then
    buy 1 contract at market
    endif

    exitTime = 080000
    if longOnMarket and dayOfWeek = 2 and time = exitTime then
    sell 1 contract at Market
    endif

    set stop %Loss 3

    #195352 quote
    pitp222pitp222
    Participant
    New

    Buonasera a tutti,ho provato a copiare come consigliato da MauroPro il programma vedi sotto e lanciare il backtesting,ma purtroppo non funziona,proprio non fa nessun acquisto,la curva guadagni perdite è una linea orizzontale,come si vede dal grafico.Vi chiedo probabilmente anzi sicuramente sbaglio qualcosa io,solo che non riesco a capire.Vi chiedo cortesemente un aiuto.Sotto il listato.

    defParam cumulateOrders = false

    if close crosses over average[50,0](close) and not longOnMarket and dayOfWeek = 1 then
    buy 5000 cash at market
    endif

    if longOnMArket and dayOfWeek = 2 then
    sell at Market
    endif

    set stop %Loss 3

    Vi  ringrazio in anticipo

    buona serata

    Pierangelo

    TIT-Giornaliero.png TIT-Giornaliero.png
    #195555 quote
    robertogozzirobertogozzi
    Moderator
    Legend

    Perché DAYOFWEEK restituisce il giorno della settimana alla chiusura della candela.

    Per restituire 1 (Lunedì), deve esserci la domenica con mercato aperto in modo che alla chiusura Domenicale segnale 1 e funziona (vedi Dax, ecc…).

    Nel caso di TELECOM non è così, quindi usa OPENDAYOFWEEK che restituisce il giorno della settimana all’APERTURA della candela. Questo, però, ti farà entrare di Martedì (alla chiusura del Lunedì) e chiudere di Mercoledì (alla chiusura del Martedì).

    #195582 quote
    pitp222pitp222
    Participant
    New

    Grazie 1000 Roberto

    Buona serata

    Pierangelo

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

trading di lunedi


ProOrder: Trading Automatico & Backtesting

New Reply
Author
author-avatar
pitp222 @pitp222 Participant
Summary

This topic contains 5 replies,
has 3 voices, and was last updated by pitp222pitp222
4 years, 3 months ago.

Topic Details
Forum: ProOrder: Trading Automatico & Backtesting
Language: Italian
Started: 06/13/2022
Status: Active
Attachments: 1 files
ProRealCode ProRealCode
Loading...