visualiser que 2 décimales

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #97899 quote
    swappingswapping
    Participant
    Master
    // Code to view result with two decimal only
    
    DefParam DrawOnLastBarOnly = true
    Period  = (20)
    ATR     = (AverageTrueRange[Period])
    DrawText("ATR(#period#) → #atr#",barindex-20,0.0,SansSerif,Standard,15)
    
    return

    Bonjour, comment modifier le code pour ne visualiser que 2 décimales avec cet exemple très simple ?

    merci bien

    #97902 quote
    robertogozzirobertogozzi
    Moderator
    Legend

    Le langage PRT ne prend pas en charge la troncature, vous pouvez seulement arrondir un nombre à deux décimales (multipliez-le par 100, puis arrondissez-le, puis divisez-le par 100), mais vous verrez toujours les 0.

    swapping thanked this post
    #98108 quote
    swappingswapping
    Participant
    Master
    // Code to view result with two decimal only
    
    DefParam DrawOnLastBarOnly = true
    Period  = (20)
    ATR     = (AverageTrueRange[Period])
    ATRnd   = round(atr*100)/100         // rounded because no troncation
    DrawText("ATR(#period#) → #ATRnd#",barindex-20,0.0,SansSerif,Standard,15)
    
    return

    merci bien roberto

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

visualiser que 2 décimales


ProOrder : Trading Automatique & Backtests

New Reply
Author
author-avatar
swapping @swapping Participant
Summary

This topic contains 2 replies,
has 2 voices, and was last updated by swappingswapping
7 years, 6 months ago.

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