Breakeven avec UT inférieure à la stratégie

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #210456 quote
    fjefbfjefb
    Participant
    New

    Bonsoir à tous,

    J’ai un algorithme fonctionnant en 30minutes (signal via un “call”), et je souhaiterais que le breakeven fonctionne dans une unité de temps inférieure (5minutes par exemple).

    J’ai essayé ceci : insérer au dessus du code breakeven “timeframe(5 minutes, updateonclose)” mais la plateforme me retourne un problème disant qu’il faut que ce soit un multiple du timeframe de la stratégie.

    Je sèche un peu et vais continuer mes recherches, en attendant si quelqu’un a une solution à ce problème j’en serais ravi ;D

    Merci d’avance.

    #210582 quote
    NicolasNicolas
    Keymaster
    Legend

    En effet, si tu places un code de breakeven dans une UT inférieure, il faudra lancer la stratégie sur cette unité de temps, c’est pour cette raison que tu obtiens ce message d’erreur.

    Pour placer un breakeven durant une bougie, grâce une unité de temps inférieure, on peut s’inspirer de cet exemple:

    defparam cumulateorders=false
    
    //declare the strategy on the 1 hour timeframe
    timeframe(1 hour, updateonclose)
    myrsi = rsi[14]
    buycondition = myrsi crosses over 50
    
    //orders management on the 1 minute timeframe
    timeframe(1 minute, default)
    //create an order at market if the RSI has crosses the level 50 on the 1 hour timeframe
    if buycondition then
     buy 10 contract at market
     //if not order on market, reset the breakeven status
     set stop loss 0
    endif
    
    //check if the current order has made 15 points of profit
    if longonmarket and close-tradeprice>=15*pointsize then
     set stop breakeven
    endif
    #210668 quote
    fjefbfjefb
    Participant
    New

    Merci Nicolas, je vais essayer avec ce code.

    #225917 quote
    ashehziashehzi
    Participant
    Average

    This fine but limits your preload by 1/30.

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

Breakeven avec UT inférieure à la stratégie


ProOrder : Trading Automatique & Backtests

New Reply
Author
author-avatar
fjefb @fjefb Participant
Summary

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

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