aucun achat ne se produit avec ce code

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #232883 quote
    bnigrell
    Participant
    New

    Bonjour,

    Nouveau sur PRT, pour me faire la main, je me lance dans un petit scenario automatisé dont voici le code :

    ******************************

    MMZC = ZLEMA[20](close)
    Graphonprice MMZC coloured (0,0,0)

    BuySignal = MMZC> MMZC[1] and MMZC[1] < MMZC[2]
    Graph BuySignal
    If BuySignal then
    buy 1 contract at market
    endif
    Sell at Market

    ***********************************

    Je suis perplexe car mon BuySignal est bien calculé et représenté sur le graphe; mais aucun achat ne se produit. Voir copie d’écran attachée

    Avez-vous une explication ? Qu’est ce que je fais de travers ?

    Merci

    Bruno

    ecran-PRT.png ecran-PRT.png
    #232890 quote
    JC_Bywan
    Moderator
    Master

    Bjr,

    De même que le buy a un if-endif sur un signal d’achat, il faudrait faire quelque chose de similaire pour définir une condition de sortie et mettre le sell at market dans un if-endif basé dessus (sinon, entrée et sortie simultanées = pas d’achat net)

    bnigrell thanked this post
Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.

aucun achat ne se produit avec ce code


ProOrder : Trading Automatique & Backtests

New Reply
Author
author-avatar
bnigrell @bnigrell Participant
Summary

This topic contains 1 reply,
has 2 voices, and was last updated by JC_Bywan
1 year, 9 months ago.

Topic Details
Forum: ProOrder : Trading Automatique & Backtests
Language: French
Started: 05/21/2024
Status: Active
Attachments: 1 files
Logo Logo
Loading...