salida despues de "n" barras

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

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

    #72147 quote
    pableitorpableitor
    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.
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

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 pableitorpableitor
8 years, 4 months ago.

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