massimi e minimi fascia oraria

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #144828 quote
    contecfcontecf
    Participant
    New
    defparam cumulateorders = false
    // stabilire minimi e massimi fascia oraria mercato giapponese
    tempo = currenttime > 000000 and currenttime < 080000
    massimo = highest[tempo](high)
    minimo = lowest[tempo](low)
    
    // condizioni di entrata e uscita
    c1 = currenttime <> tempo
    c2 = close crosses over massimo
    c3 = close crosses under minimo
    c4 = positionperf > 0.02
    
    // entrata long
    if not onmarket and c1 and c2 then
    buy 1 shares at market
    endif
    set stop loss 100
    // chiusura long
    if longonmarket and c4 then
    sell at market
    endif
    
    // entrata short
    if not onmarket and c1 and c3 then
    sellshort 1 shares at market
    endif
    set stop loss 100
    // chiusura short
    if shortonmarket and c4 then
    exitshort at market
    endif
    

    salve vorrei costruire una strategia che individui minimi e massimi di una determinata fascia oraria per poi andare ad agire sul break out di questi nel resto della giornata , ho scritto in questa maniera ma in realtà non entra in posizione quindi sto sbagliando qualcosa

    #144838 quote
    steviaggisteviaggi
    Participant
    Average

    Così ad occhio highest[tempo] non funziona. Tempo vale 1 nell’intervallo che intendi.

    #144850 quote
    NicolasNicolas
    Keymaster
    Legend

    Non utilizzare CURRENTIME ma TIME.

    #144870 quote
    contecfcontecf
    Participant
    New

    Si grazie, in effetti so che ci sono parecchie cose da sistemare ho scritto una bozza di programma per far capire l’idea di fondo e poterlo modificare

    #144875 quote
    robertogozzirobertogozzi
    Moderator
    Legend
    1. Per favore scegli il forum corretto, per le strategie è ProOrder, non ProScreener. Grazie 🙂
    2. Come ha suggerito Nicolas, usa TIME (ora di chiusura di una candela) o OPENTIME (ora di apertura di una candela), nel mio esempio ho usato OPENTIME, se vuoi sostituiscilo con TIME
    3. Non puoi usare TEMPO perché contiene un valore logico 0 o 1, se è il primo ti viene segnalato errore e la strategia viene interrotta, se è il secondo è inutile in quanto i valori di una candela sono semplicemente HIGH e LOW

    La cosa la risolvi sostituendo le righe 3-8 con queste:

    IF OpenTime >= 000000 AND OpenTime <= 080000 THEN
       IF OpenTime = 000000 OR (OpenTime < OpenTime[1]) THEN
          Massimno = high
          Minimo   = low
       ENDIF
       Massimo = max(Massimo,high)
       Minimo  = min(Minimo,low)
       c1 = 0
    ELSE
       c1 = 1
    ENDIF
    
    #144917 quote
    contecfcontecf
    Participant
    New

    grazie mille!!!

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

massimi e minimi fascia oraria


ProScreener: Scansione Mercati & Screener

New Reply
Author
author-avatar
contecf @contecf Participant
Summary

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

Topic Details
Forum: ProScreener: Scansione Mercati & Screener
Language: Italian
Started: 09/20/2020
Status: Active
Attachments: No files
ProRealCode ProRealCode
Loading...