Wrong Calculation with TRADEPRICE?

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #131698 quote
    Pietro FontanaPietro Fontana
    Participant
    Average

    Greetings all,

    maybe i’m missing something, but it seems that there’s a wrong calculation done in ProRealTime.

    I have a first value (close-tradeprice)/tradeprice =  0.05005

    I have a second value incdecfact/2 = 0.11831

    ProRealTime says the that first value is greater than the second one, see the screenshot.

    I’m making some mistakes?

    Thanks.

    Best regards.

    H7pv83xK3M.png H7pv83xK3M.png
    #131706 quote
    VonasiVonasi
    Moderator
    Master

    Are you resetting the value to zero between bars?

    #131738 quote
    NicolasNicolas
    Keymaster
    Legend

    Are you using multiple timeframes in your code? How are graphed your variables please?

    (Topic moved into the ProOrder forum for automated trading related questions).

    #131779 quote
    Pietro FontanaPietro Fontana
    Participant
    Average

    Hi,


    @Vonasi
    : no, i’m not resetting it to 0, but i should not, because close and tradeprice are builtin variables and incdectfact is calculated each time: HistoricVolatility[60](close) * 1.5


    @Nicolas
    : i’m not using multitimeframe (i still don’t have tried it), the code for graph is this:

    graph (close-tradeprice)/tradeprice > incdectfact/2
    graph incdecfact/2
    graph (close-tradeprice)/tradeprice

     

    Let me know if you need more information.

    #131782 quote
    VonasiVonasi
    Moderator
    Master

    Please use the ‘Insert PRT Code’ button when posting code – even if it is only a few lines of code. 🙂

    Pietro Fontana thanked this post
    #131787 quote
    NicolasNicolas
    Keymaster
    Legend

    Variable “incdecfact”, what is all about? CALLed from an indicator or?

    #131789 quote
    Pietro FontanaPietro Fontana
    Participant
    Average

    Hi Nicolas,

    it store an built in indicator value.

    incdecfact = HistoricVolatility[60](close) * 1.5
    #131867 quote
    Pietro FontanaPietro Fontana
    Participant
    Average

    Hi,

    i’ve found the error, it was the variable that a certain point of the code was named differently.

    Thanks for the support!

Viewing 8 posts - 1 through 8 (of 8 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

Wrong Calculation with TRADEPRICE?


ProOrder: Automated Strategies & Backtesting

New Reply
Author
Summary

This topic contains 7 replies,
has 3 voices, and was last updated by Pietro FontanaPietro Fontana
6 years, 4 months ago.

Topic Details
Forum: ProOrder: Automated Strategies & Backtesting
Language: English
Started: 05/14/2020
Status: Active
Attachments: 1 files
ProRealCode ProRealCode
Loading...