Einen Trade an einem bestimmten Tag?

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #15592 quote
    DonDollarDonDollar
    Participant
    Average

    Hallo zusammen,

    wie kann ich es in ProOrder einstellen, dass ein Kauf an einem bestimmten Tag ausgeführt wird und danach x-Tage danach verkauft wird? Was mache ich, wenn dieser Tag auf ein Wochenende fällt?

    Mein Versuch, der aber nicht in jedem Monat einen Trade auslöst:

    DayBuy = 24
    DayBuyb = 25
    DayBuyChristmas = 22
    
    // Grösse der Position
    positionSize = 1
    
    //Testing if today is not on weekend/christmas
    
    IF (CurrentDayOfWeek > 5) AND DayBuy THEN
    Daytobuy = 1
    ELSE
    Daytobuy = 0
    ENDIF
    
    IF (CurrentMonth = 12) THEN
    christmas = 1
    ELSE
    christmas = 0
    ENDIF
    
    // Go Long...and win !!
    
    IF Not LongOnMarket and Day = DayBuy and Daytobuy = 0 and christmas = 0 then
    BUY positionSize CONTRACTS AT MARKET NextBarOpen
    elsif Day = daybuyb and Daytobuy = 0 and christmas = 0 Then
    BUY positionSize Contracts at Market
    elsif Day = daybuychristmas and Daytobuy = 0 and christmas = 1 Then
    BUY positionSize Contracts at Market
    ENDIF
    
    // Bedingungen zum Ausstieg von Long-Positionen
    if onmarket and CurrentDayOfWeek < 5 AND BARINDEX-TRADEINDEX(1)>=6 then
    SELL AT MARKET
    elsif onmarket and CurrentDayOfWeek > 5 AND BARINDEX-TRADEINDEX(1)>=8 then
    SELL AT MARKET
    Endif

    Danke euch !

    Viele Grüße

    Clemens

    #15713 quote
    DonDollarDonDollar
    Participant
    Average

    Hat keiner eine Idee?

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

Stuck on this ProBuilder code?

Describe what this topic is trying to build, in plain English, and ProRealAI writes the ProRealTime™ indicator, screener or system for you.

Available in 7 languages
Try ProRealAI

Einen Trade an einem bestimmten Tag?


ProOrder: Automatischer Handel & Backtesting

New Reply
Author
author-avatar
DonDollar @dondollar Participant
Summary

This topic contains 1 reply,
has 1 voice, and was last updated by DonDollarDonDollar
9 years, 11 months ago.

Topic Details
Forum: ProOrder: Automatischer Handel & Backtesting
Language: German
Started: 10/26/2016
Status: Active
Attachments: No files
ProRealCode ProRealCode
Loading...