ingresso dopo minimo giornaliero

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #202945 quote
    romanelli4
    Participant
    Average

    Buonasera,

    chiedo cortesemente aiuto per codificare il seguente codice:

    se dalle 143000 alle 16300 si forma un minimo giornaliero

    compra quando il mio indicatore diventa long.

    e viceversa!

    Grazie mille

    Max

    #202992 quote
    MauroPro
    Participant
    Veteran

    Ci devi aggiungere il tuo indicatore.

     

    defParam cumulateOrders = false

    startHour = 143000
    endHour = 163000
    cTime = (time >= startHour and time <= endHour)

    if openTime = 000000 then
    myHighest = high
    myLowest = low
    endif
    if openTime >= 010000 and openTime <=143000 then
    myHighest = max (myHighest,high)
    myLowest = min (myLowest,low)
    endif
    //————————————————————-

    if not onMarket and cTime and low < myLowest then
    buy 1 contract at market
    endif

    if not onMarket and cTime and high > myHighest then
    sellShort 1 contract at market
    endif

    set stop %loss 1
    set target %profit 1

    #202993 quote
    MauroPro
    Participant
    Veteran

    Scusa, devi scrivere alla riga 9 : if openTime >= 000000 and openTime <= 1430000

    Se vuoi ricercare il massimo – minimo DA un orario diverso di 000000 devi scrivere il nuovo orario.  Esempio, se ricerchi un massimo – minimo dalle 8 di mattina devi sostituire 000000 con 080000.

    #203363 quote
    romanelli4
    Participant
    Average

    grazie mille Roberto

    Max

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.

ingresso dopo minimo giornaliero


ProOrder: Trading Automatico & Backtesting

New Reply
Author
author-avatar
romanelli4 @romanelli4 Participant
Summary

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

Topic Details
Forum: ProOrder: Trading Automatico & Backtesting
Language: Italian
Started: 10/23/2022
Status: Active
Attachments: No files
Logo Logo
Loading...