only one trade per day on 3 strategies

Viewing 15 posts - 16 through 30 (of 60 total)
  • Author
    Posts
  • #16231 quote
    Cosmic1
    Participant
    Senior

    If you can see the addition of the LastTradeDate lines then just copy that to your other code.  I don’t want to do it for you 🙂  Try it and let me know after you have given it a go.

    Nicolas thanked this post
    #17542 quote
    dreif123
    Participant
    Average

    hi,

    still interest in help for my different daily strategies, on the code below I only like to have one execution the day ,

    this is one strategie on a couple of , so the question is , what do I have to put in for only ONE execution the day …on DAX mini ,  1min chart

    Defparam cumulateoders=false//

    defparam flatbefore=080000

    defparam flatafter=173000

    indicator1=close

    indicator2=Bollingerdown[20](close)

    c1=(indicator1<indicator2)

    if c1 then

    buy 20 contract at market

    endif

    set stop ploss0

    set target pprofit 1

    #17546 quote
    robertogozzi
    Moderator
    Master

    This should do (try and let me know):

    // onlu ONE trade per Day
    //
    Defparam cumulateorders = false
    defparam flatbefore     = 080000
    defparam flatafter      = 173000
    ONCE OneTrade           = 0
    IF time = 000000 THEN
    OneTrade = 0
    ENDIF
    indicator1 = close
    indicator2 = Bollingerdown[20](close)
    c1 = (indicator1 < indicator2)
    c2 = (OneTrade = 0)
    if c1 AND c2 then
    buy 20 contract at market
    OneTrade = 1
    endif
    set stop ploss 0
    set target pprofit 1
    
    #17549 quote
    dreif123
    Participant
    Average

    thx first of all , should I really use “iftime=000000 then ” ….or do I have to put sthing in for 000000

    #17551 quote
    robertogozzi
    Moderator
    Master

    Just as is, no quotres, no carets, apostrophes or whatever, only 000000 (hhmmss).

    I’m pasting a more readable code:

    // only ONE trade per Day
    //
    defparam cumulateorders = false
    defparam flatbefore     = 080000
    defparam flatafter      = 173000
    ONCE OneTrade           = 0
    IF time = 000000 THEN
       OneTrade = 0
    ENDIF
    indicator1 = close
    indicator2 = Bollingerdown[20](close)
    c1         = (indicator1 < indicator2)
    c2         = (OneTrade = 0)
    if c1 AND c2 then
       buy 20 contract at market
       OneTrade = 1
    endif
    set stop   ploss   0
    set target pprofit 1
    
    
    
    #17555 quote
    dreif123
    Participant
    Average

    not working on the backtesting platform

    #17557 quote
    robertogozzi
    Moderator
    Master

    I used on a 1 minute chart and it worked, just one trade per day.

    Of course I commented out all conditions and unused variables.

    Try again.

    #17558 quote
    dreif123
    Participant
    Average

    again not working ..no trades

    #17562 quote
    robertogozzi
    Moderator
    Master

    It works on timeframes < 1 day (I used 1 minute charts, not daily) because of WHEN a strategy is processed by ProOrder.

    Each strategy is processed at the closure of the candle of the timeframe you want to deal with. In this case it is D1 (daily), so it is run when the daily candle closes. Then again after 24 hours!

    You may want to use the above code on a smaller TF trying to adjust conditions and variables so they suit a daily strategy, if possible…. otherwise drop that strategy!

    I don’t know if there is any system that can afford to scan and run ALL strategies, say every second or minute, to monitor conditions. The time required would be much greater than a second and even a minute!!!

    #17571 quote
    dreif123
    Participant
    Average

    don’t understand the point , I have put your code in as you wrote… in the 1min chart ….result is nothing will happen ..so again whats wrong

    #17573 quote
    robertogozzi
    Moderator
    Master

    It works on Aud/Cad, 1 minute, with conditions and unused variables commented out.

    See the outcome attached.

    Nicolas thanked this post
    ProOrder-strategy.jpg ProOrder-strategy.jpg ProOrder-strategy-list.jpg ProOrder-strategy-list.jpg
    #17577 quote
    dreif123
    Participant
    Average

    I asked on Dax , with daxmini in 1 minute chart !!!!!!!i don’t care on any currency stuff !!!!!!!!!!!!!

    #17582 quote
    robertogozzi
    Moderator
    Master

    You’d switch to Aud/Cad, it looks more profitable!

    #17583 quote
    dreif123
    Participant
    Average

    next time , it would be great to get an answer on what I have asked
    you are spending my time
    thx

    #17594 quote
    Cosmic1
    Participant
    Senior

    Dreif, I think you will find that my original suggestion works just fine as it did with the original I edited for you. The logic is simple to copy to your other code.  Did you try this yet as suggested? If coding is for you, it will make you better in the long run. Everyone here does not mind helping but you have to try for yourself too. 🙂

    Roberto has kindly given his time.  Comments like that are not helpful to this friendly community. If you feel something is not working, post code and pics to help explain as Roberto has done for you.

Viewing 15 posts - 16 through 30 (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...