Limite de gain mensuelle

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #160870 quote
    chelmaxchelmax
    Participant
    Junior

    Bonjour, je voudrais ajouter a ma stratégie une limite de gain mensuelle

    Ça veut dire par exemple quand le gain atteigne les 4% de mon capital alors la le système se bloque pour le reste du moi.

    Merci et bonne soirée

    #160897 quote
    NicolasNicolas
    Keymaster
    Legend

    Le code ci-dessous stocke une autorisation de trading dans la variable booléenne “trading” en fonction du rapport entre le capital au début du mois et celui actuel :

    defparam cumulateorders=false
    
    StartCapital = 10000
    
    if month<>month[1] then 
     startprofit=StartCapital+strategyprofit
    endif 
    
    trading = (startcapital+strategyprofit)/startprofit < 1.04 
    
    if trading then //trading is allowed
     //put strategy here
     if rsi[14]crosses over 50 then 
      buy 2 contracts at market 
      set target pprofit 100
      set stop ploss 50
      endif
    endif
    
    graph trading as "authorize trading"
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

Limite de gain mensuelle


ProOrder : Trading Automatique & Backtests

New Reply
Author
author-avatar
chelmax @chelmax Participant
Summary

This topic contains 1 reply,
has 2 voices, and was last updated by NicolasNicolas
5 years, 8 months ago.

Topic Details
Forum: ProOrder : Trading Automatique & Backtests
Language: French
Started: 02/09/2021
Status: Active
Attachments: No files
ProRealCode ProRealCode
Loading...