Trailing Stop —

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

    Bonjour,

    Je tourne en rond sur la problématique suivante sans trouver l’erreur.

    J’ai un stop à 1 ATR déclenché à 3 ATR.  Voici le code :

    cpATR = AverageTrueRange[14](close)
    cpTrailingTrigger = round(cpATR)
    
    IF not longonmarket THEN
    
    	IF timeTrading =1 and longTrigger THEN
      
    	BUY 1 CONTRACTS AT MARKET
    	SET STOP LOSS 50
    	SET TARGET %PROFIT 1
    
    	cpBEPrice   = tradeprice(1) +  (1.0 * cpTrailingTrigger)
    	cpBETrigger = tradeprice(1) + (3.0 * cpTrailingTrigger)
    
    	ENDIF
    ENDIF
    
    GRAPH cpBETrigger COLOURED(255,0,0) AS "cpBETrigger" //Red
    GRAPH cpBEPrice COLOURED(0,0,255) AS "cpBEPrice" //Blue
    GRAPH tradeprice(1) COLOURED(0,255,255) AS "tradeprice(1)" //Aqua
    

    Et je suis surpris par le résultat…

    tradeprice(1) = 13293.50 ce qui est ok.

    cpBEPrice = 1316.50 ce qui est ko

    cpBETrigger = 13282.50 ce qui est ko

    J’ai bien 34 de difference entre cpBETrigger  et cpBEPrice , soit  2 * cpTrailingTrigger

    Je devrais avoir :

    tradeprice(1) = 13293.50

    cpBEPrice = 13310.50 ce qui est ko

    cpBETrigger = 13344.50

    Suis je devenus si mauvais en math 🙂 ?

    Par avance merci.

    be.jpg be.jpg
    #152037 quote
    gfxgfx
    Participant
    Average

    Assez intéressant …

    // BreakEven levels
    cpBEPrice   = tradeprice(1) + 6
    cpBETrigger = tradeprice(1) + 6

    ajouter 6 reviens à retrancher 10.3

    be1.jpg be1.jpg
    #152039 quote
    gfxgfx
    Participant
    Average

    versio

    be2.jpg be2.jpg
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

Trailing Stop —


ProOrder : Trading Automatique & Backtests

New Reply
Author
author-avatar
gfx @gfx Participant
Summary

This topic contains 2 replies,
has 1 voice, and was last updated by gfxgfx
5 years, 11 months ago.

Topic Details
Forum: ProOrder : Trading Automatique & Backtests
Language: French
Started: 11/28/2020
Status: Active
Attachments: 3 files
ProRealCode ProRealCode
Loading...