Take profit sur derniers plus haut

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #160343 quote
    Noxius
    Participant
    Junior

    Bonjour,

    Je souhaiterais placer un take profit sur un des derniers plus haut sur une position long, j’ai un codé un truc mais ça pas l’air de marché correctement, en tout cas le take profit n’est jamais sur un des derniers plus haut.
    J’ai essayer de chercher sur ce forum j’ai tester quelques truc mais ça ne fonctionne toujours pas correctement.

     

    Voici le bout de code que j’ai mis pour placer le take profit:

    IF c1 AND c2 THEN
    BUY 1 SHARES AT MARKET
    set target profit highest[3](high)-close
    ENDIF

     

    C’est pour une position long.

    Et maintenant pour une position short:

    IF c4 AND c5 THEN
    SELLSHORT 1 SHARES AT MARKET
    set target profit close-lowest[3](low)
    ENDIF

     

    Je vise un take profit sur le plus haut (ou le plus bas sur un short) sur les 3 dernières bougie, ma stratégie n’a pas de stop loss

    Merci de votre aide

    #160367 quote
    Nicolas
    Keymaster
    Master

    Cela me semble pourtant correct, avec la version longue, tu peux vérifier le niveau du takeprofit ave l’instruction GRAPHONPRICE:

    IF c1 AND c2 THEN
     BUY 1 SHARES AT MARKET
     tp = highest[3](high)-close
     set target profit tp
    ENDIF
    
    graphonprice tp
    #160388 quote
    Noxius
    Participant
    Junior

    Problème résolu, j’ai pu voir avec le graphonprice que les tp était bon, ça venait d’un mauvais codage de ma stratégie

    Merci !

Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.

Take profit sur derniers plus haut


ProOrder : Trading Automatique & Backtests

New Reply
Author
author-avatar
Noxius @noxius Participant
Summary

This topic contains 2 replies,
has 2 voices, and was last updated by Noxius
5 years, 1 month ago.

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