SMA auf Strategyprofit, Lotsize

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #170841 quote
    phoentzs
    Participant
    Master

    Hallo,

    ich wollte gerne meine Positionsgröße darauf einstellen wie meine Strategie in Bezug auf Strategyprofit gerade läuft. Befindet sich die Strategie in einer UP-Phase(über einem SMA200 zum Beispiel) möchte ich die Positionsgrößen erhöhen, befindet sich die Strategie in einer Drawdownphase möchte ich die Positionsgröße auf einen Minimalwert setzen. Wie genau kann ich das programmieren?

    also:

    Strategyprofit > SMA200 = größere Position

    Strategyprofit < SMA200 = kleinere Position

    #170845 quote
    robertogozzi
    Moderator
    Master

    Da ist er.

    Was bedeutet STRATEGYPROFIT> Sma200?  Ich werde erhöhen, wenn der Gewinn steigt, und ich werde dominieren, wenn er sinkt.

    Sie entscheiden, wie viel Sie erhöhen oder verringern möchten, die beiden Werte können unterschiedlich sein, Sie können um 2 erhöhen, aber um 3 verringern (ohne jemals das Minimum zu unterschreiten):

    ONCE LotSize = 1      //starting number of lots/contracts
    ONCE MinLots = 0.5    //minimum lot size required by the broker
    ONCE Rise    = 1      //numebe of lots to increment
    ONCE Fall    = 1      //number of lots to decrement
    IF StrategyProfit > StrategyProfit[1] THEN
       LotSize = LotSize + Rise
    ELSIF StrategyProfit < StrategyProfit[1] THEN
       LotSize = LotSize - Fall
    ENDIF
    LotSize = max(MinLots,LotSize)
    IF MyLongConditions  THEN
       BUY LotSize CONTRACTS AT MARKET
    ENDIF
    IF MyShortConditions THEN
       SELLSHORT LotSize CONTRACTS AT MARKET
    ENDIF
    #170852 quote
    phoentzs
    Participant
    Master

    Ok, das sieht gut aus. Danke.
    Ich dachte eigentlich an einen Mittelwert über dem Strategyprofit, aber diese Variante gefällt mir auch sehr.

    Kann man noch eine Begrenzung einbauen? Position maximal?

    #170854 quote
    robertogozzi
    Moderator
    Master

    Ich habe das Maximum hinzugefügt und ich habe auch die Version mit dem Durchschnitt bei 200 Perioden erstellt:

    ONCE LotSize = 1      //starting number of lots/contracts
    ONCE MinLots = 0.5    //minimum lot size required by the broker
    ONCE MaxLots = 999    //999  max lots allowed (to be also set in AutoTradung)
    ONCE Rise    = 1      //numebe of lots to increment
    ONCE Fall    = 1      //number of lots to decrement
    IF StrategyProfit > StrategyProfit[1] THEN
       LotSize = LotSize + Rise
    ELSIF StrategyProfit < StrategyProfit[1] THEN
       LotSize = LotSize - Fall
    ENDIF
    LotSize = min(MaxLots,max(MinLots,LotSize))) //check both Maximum and Minimum
    IF MyLongConditions  THEN
       BUY LotSize CONTRACTS AT MARKET
    ENDIF
    IF MyShortConditions THEN
       SELLSHORT LotSize CONTRACTS AT MARKET
    ENDIF
    ONCE LotSize = 1      //starting number of lots/contracts
    ONCE MinLots = 0.5    //minimum lot size required by the broker
    ONCE MaxLots = 999    //999  max lots allowed (to be also set in AutoTradung)
    ONCE Rise    = 1      //numebe of lots to increment
    ONCE Fall    = 1      //number of lots to decrement
    AvgStrategy  = average[200,0](StrategyProfit)
    IF StrategyProfit > AvgStrategy THEN
       LotSize = LotSize + Rise
    ELSIF StrategyProfit < AvgStrategy THEN
       LotSize = LotSize - Fall
    ENDIF
    LotSize = min(MaxLots,max(MinLots,LotSize))) //check both Maximum and Minimum
    IF MyLongConditions  THEN
       BUY LotSize CONTRACTS AT MARKET
    ENDIF
    IF MyShortConditions THEN
       SELLSHORT LotSize CONTRACTS AT MARKET
    ENDIF
    phoentzs thanked this post
    #170856 quote
    phoentzs
    Participant
    Master

    Du bist der Größte. Danke.

Viewing 5 posts - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.

SMA auf Strategyprofit, Lotsize


ProOrder: Automatischer Handel & Backtesting

New Reply
Author
author-avatar
phoentzs @phoentzs Participant
Summary

This topic contains 4 replies,
has 2 voices, and was last updated by phoentzs
4 years, 8 months ago.

Topic Details
Forum: ProOrder: Automatischer Handel & Backtesting
Language: German
Started: 05/31/2021
Status: Active
Attachments: No files
Logo Logo
Loading...