only one trade per day on 3 strategies

Viewing 15 posts - 1 through 15 (of 60 total)
  • Author
    Posts
  • #15976 quote
    dreif123
    Participant
    Average

    hi,

    one  short question … I have 3 existing automatic trading  strategies …what do I have to put in , if I only like to have one execution per strategie and per day,

    thx for the support

    #15981 quote
    Cosmic1
    Participant
    Senior

    There are a couple of bits of code that may help, depending on your code. Can you share it and I can suggest what might work.

    #15983 quote
    dreif123
    Participant
    Average

    attached 3 strategies on dax mini
    1.

    DEFPARAM CumulateOrders = False //
    defparam flatbefore=080000
    defparam flatafter=173000
    
    MyRSI = RSI[14](close)
    MyBollingerDown = BollingerDown [25](close)
    
    IF MyRSI <24 AND close < MyBollingerDown then
    buy 10 CONTRACT AT MARKET
    ENDIF
    
    // Stops und Targets
    SET STOP pLOSS 12
    set target pprofit 4

    2.

    DEFPARAM CumulateOrders = False
    defparam flatbefore=090000
    defparam flatafter=173000
    
    // Bedingungen zum Einstieg in Long-Positionen
    indicator1 = MACDline[12,26,9](close)
    c1 = (indicator1 CROSSES under -7)
    
    IF c1 THEN
    BUY 5 CONTRACT AT MARKET
    ENDIF
    
    // Stops und Targets
    set target pprofit 10

    3.

     

    DEFPARAM CumulateOrders = False //
    defparam flatbefore=080000
    defparam flatafter=173000
    
    // Bedingungen zum Einstieg in Long-Positionen
    indicator1 = RSI[14](close)
    c1 = (indicator1 < 20)
    
    IF c1 THEN
    BUY 6 CONTRACT AT MARKET
    ENDIF
    
    // Stops und Targets
    SET STOP pLOSS 20
    set target pprofit 5

    these are 3 single strategies where i only like to have max 3 execution the day
    thx for your support

    #15987 quote
    Cosmic1
    Participant
    Senior

    Could you try this template. I got this from Pro Real Time them selves a few months ago. Sorry I have no time to test until tomorrow. If this doesn’t work there is another idea. You didn’t mention what time frame(s) you are testing on.

    P.S >> For clarity of messages on ProRealCode’s forums, please use the “insert code PRT” button to separate the text of the code part! Thank you! <<

    Once nbTrades = 0 
    Once tradesPerDay = 1 
    
    If Day<>Day[1] then 
    nbTrades = 0 
    Else 
    If (Not OnMarket[1] and OnMarket) xor (ShortOnMarket[1] and LongOnMarket) xor (LongOnMarket[1] and ShortOnMarket) then 
    nbTrades = nbTrades + 1 
    Endif 
    Endif 
    
    If nbTrades < tradesPerDay then 
    // Paste your code here and test, keep any DEFPARAM at the top still
    Endif 
    #16002 quote
    dreif123
    Participant
    Average

    thx first of all for your replay and support
    sorry that doesnt seem to work

    #16013 quote
    Cosmic1
    Participant
    Senior

    No difference at all? What time frame are you using?

    Try this, taken from some code by @sylvess

    DEFPARAM CumulateOrders = False
    defparam flatbefore=080000
    defparam flatafter=173000
    Once LastTradeDate = 0
    
    MyRSI = RSI[14](close)
    MyBollingerDown = BollingerDown [25](close)
    
    
    IF MyRSI <24 AND close < MyBollingerDown And LastTradeDate<>OpenDate then
    buy 10 CONTRACT AT MARKET
    LastTradeDate = OpenDate
    ENDIF
    
    // Stops und Targets
    SET STOP pLOSS 12
    set target pprofit 4
    
    
    #16039 quote
    dreif123
    Participant
    Average

    hi sylvess,
    you made my day …looks good
    thx for your support

    #16059 quote
    dreif123
    Participant
    Average

    one more question to my aim having only one trade per strategie

    attached the programm, what do i have to add , if i like to have only one trade per day :

    DEFPARAM CumulateOrders = False //
    defparam flatbefore=080000
    defparam flatafter=173000
    
    // Bedingungen zum Einstieg in Long-Positionen
    indicator1 = RSI[14](close)
    c1 = (indicator1 < 20)
    
    IF c1 THEN
    BUY 6 CONTRACT AT MARKET
    ENDIF
    
    // Stops und Targets
    SET STOP pLOSS 20
    set target pprofit 5
    #16122 quote
    Cosmic1
    Participant
    Senior

    Hi, the same modifications as suggested should work with all three, just copy the logic. Try for your self and let us know.

    #16142 quote
    dreif123
    Participant
    Average

    hi cosmic,

    thats not working …programm dont accept” Defparam flatbefore=083000 and Defparam flatafter=173000″

    #16145 quote
    dreif123
    Participant
    Average

    …sorry i did a mistake , …now it seems to be working  …thx for your support

    Cosmic1 thanked this post
    #16158 quote
    Cosmic1
    Participant
    Senior

    No worries, glad it is working.

    #16160 quote
    dreif123
    Participant
    Average

    hi cosmic , your code is not correct  …i have put in like you said …but programm shows more than one executions mid october  … i believe on the 18oct

    Once nbTrades = 0
    
    Once tradesPerDay = 1
    
    
    If Day<>Day[1] then
    
    nbTrades = 0
    
    Else
    
    If (Not OnMarket[1] and OnMarket) xor (ShortOnMarket[1] and LongOnMarket) xor (LongOnMarket[1] and ShortOnMarket) then
    
    nbTrades = nbTrades + 1
    
    Endif
    
    Endif
    
    
    If nbTrades < tradesPerDay then
    
    DEFPARAM CumulateOrders = False //
    
    defparam flatbefore=080000
    
    defparam flatafter=173000
    
    
    // Bedingungen zum Einstieg in Long-Positionen
    
    indicator1 = RSI[14](close)
    
    c1 = (indicator1 < 20)
    
    
    IF c1 THEN
    
    BUY 6 CONTRACT AT MARKET
    
    ENDIF
    
    
    // Stops und Targets
    
    SET STOP pLOSS 20
    
    set target pprofit 5
    
    endif
    #16168 quote
    Cosmic1
    Participant
    Senior

    I think this logic / example will serve you better.

    DEFPARAM CumulateOrders = False
    defparam flatbefore=080000
    defparam flatafter=173000
    Once LastTradeDate = 0
    
    MyRSI = RSI[14](close)
    MyBollingerDown = BollingerDown [25](close)
    
    
    IF MyRSI <24 AND close < MyBollingerDown And LastTradeDate<>OpenDate then
    buy 10 CONTRACT AT MARKET
    LastTradeDate = OpenDate
    ENDIF
    
    // Stops und Targets
    SET STOP pLOSS 12
    set target pprofit 4
    #16180 quote
    dreif123
    Participant
    Average

    hi , thats on bollinger   ….but how does it have to look like on the above mentioned rsi stuff

    DEFPARAM CumulateOrders = False //
    
    defparam flatbefore=080000
    
    defparam flatafter=173000
    
    
    // Bedingungen zum Einstieg in Long-Positionen
    
    indicator1 = RSI[14](close)
    
    c1 = (indicator1 < 20)
    
    
    IF c1 THEN
    
    BUY 6 CONTRACT AT MARKET
    
    ENDIF
    
    
    // Stops und Targets
    
    SET STOP pLOSS 20
    
    set target pprofit 5
    
    
    
    
    
    
    
    
    
    
    
    
    indicator1 = RSI[14](close)
    
    c1 = (indicator1 < 20)
    
    
    IF c1 THEN
    
    BUY 6 CONTRACT AT MARKET
    
    ENDIF
    
    
    // Stops und Targets
    
    SET STOP pLOSS 20
    
    set target pprofit 5
Viewing 15 posts - 1 through 15 (of 60 total)
  • You must be logged in to reply to this topic.

only one trade per day on 3 strategies


Platform Support: Charts, Data & Broker Setup

New Reply
Author
author-avatar
dreif123 @dreif123 Participant
Summary

This topic contains 59 replies,
has 6 voices, and was last updated by Andy11
9 years ago.

Topic Details
Forum: Platform Support: Charts, Data & Broker Setup
Language: English
Started: 11/04/2016
Status: Active
Attachments: No files
Logo Logo
Loading...