Abfrage ob für alle Werte die Bedingung stimmt

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #241791 quote
    Suffi
    Participant
    Junior

    Hallo zusammen,

    wie stelle ich die Abfrage ob die Bedingung für alle Werte von “n” erfüllt ist?

    FOR n=2 to 10 do
    C11= indicator1[n]<indicator1[n-1]
    next
    #241793 quote
    JS
    Participant
    Senior

    Hallo Suffi,

    c11=Summation[9](indicator1[n]<indicator1[n-1])=9

    robertogozzi, Iván González, Suffi and druby thanked this post
    #241829 quote
    Suffi
    Participant
    Junior

    Danke für die Unterstützung, ich werde es ausprobieren

    #242010 quote
    Suffi
    Participant
    Junior

    gibt es für die for do Anweisung auch eine Angabe wie groß die Schritteite sein soll?

    Bsp.: FOR n=0 to 20 STEP 2

    Gruß

    Suffi

    #242014 quote
    JS
    Participant
    Senior

    Sie können für eine “For-Schleife” keine Schrittweite angeben, sie ist immer 1…

    In diesem Fall sollten Sie ebenfalls eine Schrittweite von 1…

    C11=0

    For n=2 to 10 do

    C11=Summation[9](indicator1[n]<indicator1[n-1])=9

    Next

    Return c11

    #242020 quote
    druby
    Participant
    New
    Sie können einen STEP-Wert mit den Schlüsselwörtern MODULUS und CONTINUE in einem IF/ENDIF-Block erstellen. WENN es einen Bedarf gibt.
    a=0 // line offset value
    
    step = 3  // integer
    for i = 0 to 32
    if i mod step then
    continue
    endif
    
    // code...
    
    drawtext(a,-80,-50 -( a*12)) anchor(top,xshift,yshift) coloured("red")
    drawtext(i,-40,-50 -( a*12)) anchor(top,xshift,yshift)
    a=a+1
    next
    
    return
    
    /*  step = 3
    
    if i = 0 then  0 / 3 = 0 remainder 0 **
    if i = 1 then  1 / 3 = 0 remainder 3
    if i = 2 then  2 / 3 = 0 remainder 3
    if i = 3 then  3 / 3 = 1 remainder 0
    ...
    ...
    
    ** Since 0 divided by any non-zero number equals zero
    
    */
    
    
    JS, robertogozzi and Suffi thanked this post
Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.

Abfrage ob für alle Werte die Bedingung stimmt


ProOrder: Automatischer Handel & Backtesting

New Reply
Author
author-avatar
Suffi @suffi Participant
Summary

This topic contains 5 replies,
has 3 voices, and was last updated by druby
1 year, 1 month ago.

Topic Details
Forum: ProOrder: Automatischer Handel & Backtesting
Language: German
Started: 12/25/2024
Status: Active
Attachments: No files
Logo Logo
Loading...