salida despues de "n" barras

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #69718 quote
    josemi
    Participant
    Average

    HOla A TODOS!! Alguien me puede ayudar a escribir como salir de una operacion despues de n barras, gracias

    #72147 quote
    pableitor
    Participant
    Master

    Se me ocurre algo sencillo, por ejemplo:

    if condition and not onmarket then
    buy 1 contracts at market  // si se cumple la condicion y estamos cerrados abrir 1 largo
    x = barindex // x = numero de vela en la que abrimos largos
    endif
    
    if barindex = x + n then  // si han pasado n velas desde la compra, cerramos largos
    sell 1 contract at market
    endif
    Nicolas thanked this post
Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.

salida despues de "n" barras


ProOrder: Trading Automático y Backtesting

New Reply
Author
author-avatar
josemi @josemi Participant
Summary

This topic contains 1 reply,
has 2 voices, and was last updated by pableitor
7 years, 9 months ago.

Topic Details
Forum: ProOrder: Trading Automático y Backtesting
Language: Spanish
Started: 05/03/2018
Status: Active
Attachments: No files
Logo Logo
Loading...