Trade nur wenn Equity über GD 5

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

    Hallo,

     

    ist es möglich einem Code eine Anweisung zu geben, dass ein Trade nur dann erfolgt wenn die Equity über dem Moving Average 10 liegt?

    Ziel ist es die schlechten Phasen des Sytem zu filtern??

     

    Geht das??

    Danke

    Hier ein einfacher Code dazu

    if not longonmarket and Time > 150000 then

    buy 1 shares at market

    if long onmarket and Dayofweek = 5 and time > 170000 then

    sell at market

    #211108 quote
    Nicolas
    Keymaster
    Master

    Ja, bitte finden Sie unten den Code, um Orders nur dann zu eröffnen, wenn das Eigenkapital über seinem gleitenden 10-Perioden-Durchschnitt liegt:

    if not longonmarket and Time > 150000 and close>average[10] then
     buy 1 shares at market
    endif
    
    if longonmarket and Dayofweek = 5 and time > 170000 then
     sell at market
    endif
    #211243 quote
    axmichi
    Participant
    Senior

    Hallo Nicolas,

     

    danke, ich meinte es jedoch anders:

     

    Wenn die  Strategieprofit Kurve über den SMA ist, dann Trade ON wenn der Strategieprofit unter dem SMA ist, dann Trade off

    Ziel ist es schwache Phasen zu filtern

    Siehe Bild

    Strategieprofit-over-SMA.png Strategieprofit-over-SMA.png
    #211321 quote
    GraHal
    Participant
    Master
    if not longonmarket and Time > 150000 and StrategyProfit>average[5]StrategyProfit then
     buy 1 shares at market
    endif
     
    if longonmarket and Dayofweek = 5 and time > 170000 OR StrategyProfit< average[5]StrategyProfit then
     sell at market
    endif
    #211323 quote
    GraHal
    Participant
    Master
    If StrategyProfit>average[5]StrategyProfit then
    tradeON
    Else TradeOFF
    Endif
    
    If TradeON AND not longonmarket and Time > 150000 then
    buy 1 shares at market
    endif
     
    if longonmarket and Dayofweek = 5 and time > 170000 OR TradeOff then
     sell at market
    endif
    #211376 quote
    axmichi
    Participant
    Senior

    Danke!!

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

Trade nur wenn Equity über GD 5


ProOrder: Automatischer Handel & Backtesting

New Reply
Author
author-avatar
axmichi @axmichi Participant
Summary

This topic contains 5 replies,
has 3 voices, and was last updated by axmichi
3 years ago.

Topic Details
Forum: ProOrder: Automatischer Handel & Backtesting
Language: German
Started: 03/08/2023
Status: Active
Attachments: 1 files
Logo Logo
Loading...