MM mobile et CCI

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #105060 quote
    GLGGLG
    Participant
    Senior

    Bonjour je souhaite créer un système a l’aide d’une moyenne mobile x période et d’un CCI  . Le CCI donnera des signaux d’achat quant la MM sera croissante et des signaux de VAD dans le cas contraire .

    j’ai écrit ceci mais le programme ne tient  pas compte de la MM il continu d’acheter lorsque la MM est en baisse.

    DEFPARAM CumulateOrders = False // Cumul des positions désactivé
    
    // Conditions pour ouvrir une position acheteuse
    indicator1 = Average[80]
    indicator2 = Average[80]
    c1 = (indicator1 > indicator2[1])
    indicator3 = CCI[50]
    c2 = (indicator3 CROSSES OVER 0)
    indicator4 = CCI[50]
    c3 = (indicator4 CROSSES OVER -100)
    indicator4 = CCI[50]
    c4 = (indicator4 CROSSES OVER -200)
    
    IF c1 AND c2 or c3 or c4 THEN
    BUY 10000 CASH AT MARKET
    ENDIF

     

    Pourriez vous m’aider ?

    Merci

    #105205 quote
    NicolasNicolas
    Keymaster
    Legend

    Ton problème est lié à la condition que tu as codée à la ligne 14.

    Si je comprends bien le fonctionnement, tu veux C1 et (C2 ou C3 ou C4)

    Remarque les parenthèses ! Il faut scinder ta condition de tendance C1 et l’une ou l’autre des 3 autres conditions du CCI. (voir la formation sur la programmation pour les débutants ici: Premiers pas avec la programmation pour ProRealTime

    On aurait donc à la place:

    IF c1 AND ( c2 or c3 or c4 ) THEN
     BUY 10000 CASH AT MARKET
    ENDIF
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

MM mobile et CCI


ProOrder : Trading Automatique & Backtests

New Reply
Author
author-avatar
GLG @glg Participant
Summary

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

Topic Details
Forum: ProOrder : Trading Automatique & Backtests
Language: French
Started: 08/19/2019
Status: Active
Attachments: No files
ProRealCode ProRealCode
Loading...