MACD en 15min et en 1 heure

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #90983 quote
    finplus
    Participant
    Master

    Bonsoir,

    mon programme est tout simple et pourtant je n’arrive pas à le programmer efficacement. Je voudrais qu’une position soit prise (achat ou vente à découvert donc buy or sellshort) lorsqu’en 15 minutes le macd croise sa ligne de signal (par exemple à la hausse) et qu’en timeframe 1 heure le macd soit au dessus de sa ligne de signal.

    quelqu’un pourrait il m’aider sur cette programmation?

    merci d’avance.

    #91080 quote
    Nicolas
    Keymaster
    Master

    Cela me fait penser à un exemple tout simple de stratégie MTF avec un MACD, sans doute à adapter un chouia ! 🙂

    Voici le lien du sujet où on en parle : https://www.prorealcode.com/topic/echelle-de-temps-multiples/#post-82039

    et l’exemple de code en question :

    defparam cumulateorders=false
    
    timeframe(10 minutes,updateonclose)
    macd10 = MACD[12,26,9](close)
    
    timeframe(5 minutes,updateonclose) //or timeframe(default) on a 5 minutes TF
    macd5 = MACD[12,26,9](close)
    
    condition = macd10>0 and macd5>0
    
    if not longonmarket and condition then
     buy at market
    endif
Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.

MACD en 15min et en 1 heure


ProOrder : Trading Automatique & Backtests

New Reply
Author
author-avatar
finplus @finplus Participant
Summary

This topic contains 1 reply,
has 2 voices, and was last updated by Nicolas
7 years, 1 month ago.

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