Salir de posiciones abiertas sin hacer QUIT cuando finalice tramo horario

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #229433 quote
    gustavobpgustavobp
    Participant
    New

    Buenas amigos, hay alguna manera de hacer esta optimizacion sin hacer QUIT ?

    IF time >= HoraMadrugadaInicio AND time <= HoraMadrugadaFin OR time >= HoraDiarioInicio AND time <= HoraDiarioFin THEN
    QUIT //NECESITARIO UNA CONDICION QUE NO SEA QUIT PARA QUE NO SE ME DETENGA EL SISTEMA Y TENGA QUE REINICIARLO MANUALMENTE EN EL SIGUIENTE TRAMO HORARIO. MI IDEA ES HACE QUE CUANDO FALTEN 5 MINUTOS PARA LLEGAR AL FIN DEL TRAMO DE HORARIO DE TRADING DEFINIDO QUE ME CIERRE TODAS POSICIONES LONG O SHORT ABIERTAS, PERO QUE NO DETENGA AL SISTEMA
    ENDIF

    Muchas grcaiasssss

    #229457 quote
    robertogozzirobertogozzi
    Moderator
    Legend

    Prueba esto:

    IF Time = 225500 THEN
       SELL AT MARKET
       EXITSHORT AT MARKET
    ENDIF

    Esto funciona en el marco de tiempo de 5 minutos o 1 minuto, porque la vela debe abrirse o cerrarse exactamente en el tiempo especificado.
    Si quieres utilizar un periodo de tiempo de 10 minutos tendrás que escribir 225000, si es de 30 minutos escribir 223000, etc…

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

Salir de posiciones abiertas sin hacer QUIT cuando finalice tramo horario


ProOrder: Trading Automático y Backtesting

New Reply
Author
author-avatar
gustavobp @gustavobp Participant
Summary

This topic contains 1 reply,
has 2 voices, and was last updated by robertogozzirobertogozzi
2 years, 6 months ago.

Topic Details
Forum: ProOrder: Trading Automático y Backtesting
Language: Spanish
Started: 03/08/2024
Status: Active
Attachments: No files
ProRealCode ProRealCode
Loading...