Which code is faster?

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #131502 quote
    smhhadimasmhhadima
    Participant
    Junior

    will this code execute faster than the below code?

    //Code 1
    temp1=(close>open)
    if(temp1) then
     .....
    endif
    
    temp1=(close>10) //I will reuse the same temporary variable again
    if(temp1) then
     .....
    endif
      or this code will be faster?
    //Code 1
    temp1=(close>open)
    if(temp1) then
     .....
    endif
    
    temp2=(close>10) //I will another temporary variable
    if(temp2) then
     .....
    endif
    #131504 quote
    robertogozzirobertogozzi
    Moderator
    Legend
    It’s the same, maybe the second one might spare some RAM, but speed won’t be affected. This link might be of some interest https://www.prorealcode.com/blog/learning/speed-calculation-indicator/.
Viewing 2 posts - 1 through 2 (of 2 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

Which code is faster?


ProBuilder: Indicators & Custom Tools

New Reply
Author
author-avatar
smhhadima @smhhadima Participant
Summary

This topic contains 1 reply,
has 2 voices, and was last updated by robertogozzirobertogozzi
6 years, 4 months ago.

Topic Details
Forum: ProBuilder: Indicators & Custom Tools
Language: English
Started: 05/13/2020
Status: Active
Attachments: No files
ProRealCode ProRealCode
Loading...