Remonter le stop si trade positif

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #137590 quote
    Plop61Plop61
    Participant
    Average

    Bonjour,

    J’essaie de remonter mon stop de 20 points lorsque le trade est positif de 15 points, mais cela ne marche pas.

    Voici le code :

    IF NOT ONMARKET THEN
    NouveauStop=0
    ENDIF
    
    IF LONGONMARKET AND close-tradeprice(1)> 15 and NouveauStop=0 THEN
    NouveauStop = tradeprice(1) - (StopInitial + 20)
    ENDIF
    
    IF longonmarket and NouveauStop >0 THEN
    SELL AT NouveauStop STOP
    ENDIF

    Merci pour votre aide.

    #137605 quote
    NicolasNicolas
    Keymaster
    Legend

    Peut être que 15 n’est pas adapté à la taille d’un point de l’instrument ? 1 point vaut vraiment 1 ou 0.01 ou 0.0001 ? ou …. ?

    Le mieux est toujours d’utiliser une conversion à l’instrument tradé pour que ce soit universel :

    IF NOT ONMARKET THEN
    NouveauStop=0
    ENDIF
    
    IF LONGONMARKET AND close-tradeprice(1)> 15 * pointsize and NouveauStop=0 THEN
    NouveauStop = tradeprice(1) - (StopInitial + 20 * pointsize)
    ENDIF
    
    IF longonmarket and NouveauStop >0 THEN
    SELL AT NouveauStop STOP
    ENDIF

    Par ailleurs en faisant un GRAPHONPRICE de ton niveau de stop, ça te permettrait de comprendre ce qui cloche :

    graphonprice NouveauStop
    #137793 quote
    Plop61Plop61
    Participant
    Average

    merci 🙂

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

Remonter le stop si trade positif


ProOrder : Trading Automatique & Backtests

New Reply
Author
author-avatar
Plop61 @plop61 Participant
Summary

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

Topic Details
Forum: ProOrder : Trading Automatique & Backtests
Language: French
Started: 06/30/2020
Status: Active
Attachments: No files
ProRealCode ProRealCode
Loading...