Schleife kürzer fassen

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

    Moin,

     

    kann man das hier kürzer schreiben?

    if myEMA > myWMA+20 then 
    resultMA = 2
    else
    if myEMA > myWMA+5 AND myEMA < myWMA+20 then
    resultMA = 1
    else 
    if myEMA < myWMA-20 then
    resultMA = -2
    else
    if myEMA < myWMA-5 AND myEMA > myWMA-20 then
    resultMA = -1
    else
    resultMA=0
    ENDIF
    ENDIF
    ENDIF
    ENDIF
    #207083 quote
    robertogozzirobertogozzi
    Moderator
    Legend

    So hätte ich es codiert (ich habe es aber nicht ausprobiert):

    resultMA=0
    if myEMA > myWMA+20 then
       resultMA = 2
    elsif myEMA > myWMA+5 then
       resultMA = 1
    elsif myEMA < myWMA-20 then
       resultMA = -2
    elsif myEMA < myWMA-5 then
       resultMA = -1
    ENDIF
    killerplatuze thanked this post
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

Schleife kürzer fassen


ProBuilder: Indikatoren & Custom Tools

New Reply
Author
Summary

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

Topic Details
Forum: ProBuilder: Indikatoren & Custom Tools
Language: German
Started: 01/08/2023
Status: Active
Attachments: No files
ProRealCode ProRealCode
Loading...