Schleife kürzer fassen

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #207077 quote
    killerplatuze
    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
    robertogozzi
    Moderator
    Master

    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.

Schleife kürzer fassen


ProBuilder Support

New Reply
Author
Summary

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

Topic Details
Forum: ProBuilder Support
Language: German
Started: 01/08/2023
Status: Active
Attachments: No files
Logo Logo
Loading...