Variable für > < Zeichen

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #250151 quote
    axmichi
    Participant
    Senior

    Hallo,

     

    kann man eigentlich ein Variable vergeben für ein > oder < Zeichen, sodass der Backtest entscheidet was besser ist.

     

    Wenn zum Beispiel mein Code lautet:

     

    if longonmarket and Close[3] < High[4] then

    buy at market

    Danke

    #250160 quote
    Iván González
    Moderator
    Master

    Ich weiß nicht, ob ich es richtig verstanden habe… In ProBuilder ist es nicht möglich, einem Vergleichsoperator (wie < oder >) direkt eine Variable zuzuweisen, da Operatoren nicht als Werte behandelt werden können. Du kannst jedoch dasselbe Ziel erreichen, indem du eine boolesche Variable verwendest, die steuert, welcher Vergleich in jedem Fall angewendet wird. Hier ist ein Beispiel:

    // 1 = use "<", 0 = use ">"
    usarMenor = 1
    
    IF longonmarket THEN
        IF usarMenor = 1 THEN
            IF close[3] < high[4] THEN
                BUY AT MARKET
            ENDIF
        ELSE
            IF close[3] > high[4] THEN
                BUY AT MARKET
            ENDIF
        ENDIF
    ENDIF
    robertogozzi thanked this post
    #250180 quote
    axmichi
    Participant
    Senior

    Hallo,

    danke, ich bin mir nicht sicher

    schau mal, ich habe deinen Code in ein einfaches System kopiert.

    Ich möchte herausfinden, welche Variante besser gewesen wäre, diese Close[3] < High[4]  oder diese Close[3] > High[4]

    hier der Code:

     

    // 1 = use “<“, 0 = use “>”
    usarMenor = 1

    IF longonmarket THEN
    IF usarMenor = 1 THEN
    IF close[3] < high[4] THEN
    BUY AT MARKET
    ENDIF
    ELSE
    IF close[3] > high[4] THEN
    BUY AT MARKET
    ENDIF
    ENDIF
    ENDIF

    if not onmarket and RSI[14](close) < 30 and Close[3] < High[4]  or Close[3] > High[4] THEN
    buy 1 shares at market
    endif

    if onmarket and barindex – Tradeindex > 6 THEN
    sell at market
    endif

    #250187 quote
    Iván González
    Moderator
    Master

    Es wäre so etwas wie:

    usarMenor = 1
    
    IF usarMenor = 1 THEN
    
    if not onmarket and RSI[14](close) < 30 and close[3] < high[4] THEN
    BUY 1 contract AT MARKET
    ENDIF
    
    if onmarket and barindex - Tradeindex > 6 THEN
    sell at market
    endif
    
    ELSE
    
    if not onmarket and RSI[14](close) < 30 and close[3] > high[4] THEN
    BUY 1 contract AT MARKET
    ENDIF
    
    if onmarket and barindex - Tradeindex > 6 THEN
    sell at market
    endif
    
    ENDIF
    
    
    robertogozzi thanked this post
Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.

Variable für > < Zeichen


ProOrder: Automatischer Handel & Backtesting

New Reply
Author
author-avatar
axmichi @axmichi Participant
Summary

This topic contains 3 replies,
has 2 voices, and was last updated by Iván González
5 months, 1 week ago.

Topic Details
Forum: ProOrder: Automatischer Handel & Backtesting
Language: German
Started: 08/28/2025
Status: Active
Attachments: No files
Logo Logo
Loading...