Limit mit weiterer Bedingung

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #211271 quote
    axmichi
    Participant
    Senior
    //defparam flatbefore=154500
    defparam flatafter=214500
    
    if intradaybarindex=0 then
    trading=1
    elsif barindex=tradeindex then
    trading=0
    endif
    
    if time = 180000 then
    myprice=close
    
    endif
    Spanne = 0.58
    starttime = 180000
    
    if not longonmarket and time >= starttime and trading=1 then
    buy 300 share at myprice-Spanne*pointsize limit
    endif

    Hallo,

     

    dieser Code legt nach 18:00 Uhr eine Limitorder unter dem close von 18 Uhr in den Markt.

    Ich möchte das das nur passiert wenn der Kurs am selben Tag vor 18 Uhr schon mal unter dem level von myprice (close 18 Uhr ) gewesen ist.

    Geht das zu codieren?

    Vielen Dank

    #211395 quote
    robertogozzi
    Moderator
    Master

    Versuche dies:

    //defparam flatbefore=154500
    defparam flatafter=214500
     
    if intradaybarindex=0 then
    trading=1
    c1     =0
    elsif barindex=tradeindex then
    trading=0
    endif
     
    if time = 180000 then
    c1      = 0
    myprice = close
    FOR i = 1 TO (IntraDayBarIndex - 1)
    c1 = close[i] < myprice
    IF c1 THEN
    break
    ENDIF
    NEXT
    endif
    Spanne = 0.58
    starttime = 180000
     
    if not longonmarket and time >= starttime and trading=1 and c1 then
    buy 300 share at myprice-Spanne*pointsize limit
    endif
    #211535 quote
    axmichi
    Participant
    Senior

    Danke sehr, das hilft mir weiter….

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

Limit mit weiterer Bedingung


ProOrder: Automatischer Handel & Backtesting

New Reply
Author
author-avatar
axmichi @axmichi Participant
Summary

This topic contains 2 replies,
has 2 voices, and was last updated by axmichi
2 years, 11 months ago.

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