codigo de calculo de contratos

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #204571 quote
    DECO2021DECO2021
    Participant
    New

    Hola.

    Alguien me puede decir como se escribe el código para que me invierta el 2% del capital en cada entrada???.

    Lo escribo así pero no me funciona.

    capitalinicial = 10000
    BUY 2/100 * (strategyprofit + capitalinicial) SHARES AT MARKET
    ENDIF

    Gracias.

    #204574 quote
    robertogozzirobertogozzi
    Moderator
    Legend

    Funciona muy bien en AAPL (Apple), marco de tiempo diario:

    defParam cumulateOrders = False
    capitalinicial = 10000
    c1 = close crosses over average[50,0]
    IF c1 AND Not OnMarket THEN
       BUY 2/100 * (strategyprofit + capitalinicial) SHARES AT MARKET
    ENDIF
    set stop   ploss   200
    set target pprofit 600
    DECO2021 thanked this post
    #204655 quote
    DECO2021DECO2021
    Participant
    New

    Muchas gracias. Me ha sido de gran ayuda. Saludos.

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

codigo de calculo de contratos


ProOrder: Trading Automático y Backtesting

New Reply
Author
author-avatar
DECO2021 @deco2021 Participant
Summary

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

Topic Details
Forum: ProOrder: Trading Automático y Backtesting
Language: Spanish
Started: 11/21/2022
Status: Active
Attachments: No files
ProRealCode ProRealCode
Loading...