Entre 20h30 et 21h00, acheter 1 contrat au marché

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #230302 quote
    rouxdan1
    Participant
    New

    Bonjour à tous,

    Je souhaite écrire un programme, à mon avis tout simple, me permettant de faire acheter par la machine 1 contrat d’indice tous les jours entre 20h30 et 21h00 dans les conditions suivantes (sachant que l’unité de temps de trading (timeframe) est de 30mn):

    • la bougie précédente, entre 20h00 et 20h30 doit être verte
    • la bougie précédente cette dernière, donc entre 19h30 et 20h00, doit être verte également
    • L’indicateur stochastics (5.3.3) doit se situer en zone inférieure ou intermédiaire durant les 2 bougies de condition, c’est à dire inférieur à 80 entre 19h30 et 20h30.

     

    CI-dessous le programme que j’ai écrit, qui apparemment ne comporte pas de faute de syntaxe, mais qui ne tourne pas

    Un très grand merci si vous pouvez m’aider

    Daniel

    
    
    Defparam Cumulateorders=false
    Defparam Flatbefore = 203000
    Defparam Flatafter = 210000
    
    //Conditions
    
    c1 = close [1] > open [1]
    c2 = close [2] > open [2]
    c3 = Time > 203000 AND TIME < 210000
    
    IF NOT LongOnMarket AND c1 AND c2 AND c3 THEN
    BUY 1 SHARE AT MARKET
    ENDIF
    
    IF TRADEINDEX (0) > 1 THEN
    SELL AT MARKET
    ENDIF
    
    
    #230310 quote
    JS
    Participant
    Senior

    Hi,

    I don’t really understand how you want to use the stochastic, when you want to go “Long” it makes little sense to know if the stochastic is below 80, I would rather expect something like: If %K CrossesOver %D then…

    The first part of your code will be going to look like:

    If OpenTime=083000 and Close[1]>Open[1] and Close[2]>Open[2] and …

    Buy 1 Share at Market

    Iván González thanked this post
    #230413 quote
    Iván González
    Moderator
    Master
Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.

Entre 20h30 et 21h00, acheter 1 contrat au marché


ProOrder: Automated Strategies & Backtesting

New Reply
Author
author-avatar
rouxdan1 @rouxdan1 Participant
Summary

This topic contains 2 replies,
has 3 voices, and was last updated by Iván González
1 year, 10 months ago.

Topic Details
Forum: ProOrder: Automated Strategies & Backtesting
Language: English
Started: 03/22/2024
Status: Active
Attachments: No files
Logo Logo
Loading...