3 trades per day

Viewing 15 posts - 1 through 15 (of 17 total)
  • Author
    Posts
  • #115024 quote
    Razz
    Participant
    Master

    Hi

    I want my trading system to only do 3 trades a day, what do I have to do?

    I don’t know what to do next

    Thank you

     

    once Tradetag=0
    If onmarket then
    Tradetag=date
    endif
     
    If not onmarket and time>= Startzeit and time < Endzeit and Tradetag<>date  and Spannepoints < MaxBox  then
    BUY Position Lot AT Hi+L Stop
    Sellshort Position Lot AT Lo-S Stop
    #115028 quote

    Try this, it should work.

    if intradaybarindex = 0 then
    countposition=0
    endif
    condnbposperday=countposition <= 3
    if not longonmarket and condition and condnbposperday then
    buy 1 shares at market
    countposition=countposition+1
    endif
    robertogozzi thanked this post
    #115030 quote
    Vonasi
    Moderator
    Master

    Mauro – your suggestion only works for at market orders. Razz’s example uses stop orders and so it is that a trade can be opened and closed within a candle. This means that simply adding one to a count does not work and using COUNTOFPOSITION does not work as the count would be zero at the candles close in this case.

    We need to check both COUNTOFPOSITION and STRATEGYPROFIT at the candles close. Nicolas has a code snippet which hopefully he will share again here soon.

    #115031 quote
    Nicolas
    Keymaster
    New

    The problem is that Razz is using pending stop orders and so you can’t increase an order count each time you set them, but when they are actually triggered.

    Try with this snippet:

    if intradaybarindex=0 or day<>day[1] then 
     count=0
    endif
    
    if  ( (not onmarket and onmarket[1] and not onmarket[2]) or (tradeindex(1)=tradeindex(2) and tradeindex(1)=barindex[1] and tradeindex(1)>0) or (not onmarket and onmarket[1]))   then
      count=count+1
    endif
    
    if count<3 then 
     ...
    endif

     

    #115032 quote
    Nicolas
    Keymaster
    New

    “soon” means at the same exact time Vonasi 😆

    #115034 quote
    Vonasi
    Moderator
    Master

    “soon” means at the same exact time Vonasi 😆

    I knew you were fast but not that fast!

    #115038 quote
    Razz
    Participant
    Master

    Thank you for your help, I hope I entered it correctly. I watch how it works.

    if intradaybarindex=0 or day<>day[1] then
    count=0
    endif
     
    if  ( (not onmarket and onmarket[1] and not onmarket[2]) or (tradeindex(1)=tradeindex(2) and tradeindex(1)=barindex[1] and tradeindex(1)>0) or (not onmarket and onmarket[1]))   then
    count=count+1
    endif
     
    if count<3 then
    Trade=1
    endif
     
    If not onmarket and time>= Startzeit and time < Endzeit and Trade=1  and Spannepoints < MaxBox  then
    BUY Position Lot AT Hi+(Spread/2) Stop
    Sellshort Position Lot AT Lo-(Spread/2) Stop

     

    Thank you

    #115042 quote
    Nicolas
    Keymaster
    New

    It will not work as you never reset “Trade” to 0. You should do it like this:

    if intradaybarindex=0 or day<>day[1] then
    count=0
    endif
     
    if  ( (not onmarket and onmarket[1] and not onmarket[2]) or (tradeindex(1)=tradeindex(2) and tradeindex(1)=barindex[1] and tradeindex(1)>0) or (not onmarket and onmarket[1]))   then
    count=count+1
    endif
     
    If not onmarket and time>= Startzeit and time < Endzeit and count<3  and Spannepoints < MaxBox  then
    BUY Position Lot AT Hi+(Spread/2) Stop
    Sellshort Position Lot AT Lo-(Spread/2) Stop
    #115043 quote
    Razz
    Participant
    Master

    I probably did something wrong, in the picture all 3 systems. 2 trades are not ok

    if intradaybarindex=0 or day<>day[1] then
    count=0
    endif
     
    if  ( (not onmarket and onmarket[1] and not onmarket[2]) or (tradeindex(1)=tradeindex(2) and tradeindex(1)=barindex[1] and tradeindex(1)>0) or (not onmarket and onmarket[1]))   then
    count=count+1
    endif
     
    if count<3 then
    Trade=1
    endif
    
     
    If not onmarket  and time>= Startzeit and time < Endzeit and Trade=1  and Spannepoints < MaxBox  then
    BUY Position Lot AT Hi+(Spread/2) Stop
    Sellshort Position Lot AT  Lo-(Spread/2) Stop
    
    ENDIF
     
    // Stops und Targets
    SET STOP pLOSS Spannepoints*y
    SET TARGET pPROFIT Spannepoints *x
    
    #115045 quote
    Razz
    Participant
    Master

    Thanks Nicolas the new code is better but he is still buying a position he is not allowed to.
    please look at the Picture.

    Many thanks for your help

    #115065 quote
    Nicolas
    Keymaster
    New

    Why not allowed?, the max position is set to 3 per day and I count 3 orders on your last screenshot.

    #115067 quote
    Razz
    Participant
    Master

    3 trades are ok, but the 3 entry must not be, condition should be that the Lo of the range 0800-0900 is the signal.

    #115086 quote
    Razz
    Participant
    Master

    Nicolas I work limited to 2 trades per day, the results have changed very well. less profit trading but more profit. I will continue to watch the whole thing and if I really run the strategy in the real account a programmer should look over there.

    Nicolas,Vonasi,Mauro

    Many thanks for your help

    Nicolas thanked this post
    #115099 quote
    cjr30
    Participant
    New

    Good afternoon. I am sorry that I get involved in the Razz issue. I have a similar system in which instead of limiting the number of daily orders, I limit the number of lost orders.
    I comment because your system reminds me of one that I have, based on the Mark Fisher ACD system. In this system, the maximum and minimum are set in a time range, but those values are not entered, but the maximum amount is added by the percentage of the average true range value of the previous day and the minimum is subtracted That same percentage. This prevents us from false breaks.
    As you can see on the screen you have said you say that the last operation is not allowed, however, notice, that it returns almost to the initial position (that is, at the minimum of the range), then go back down and have a very good operation.
    It is simply an idea.

    #115167 quote
    Razz
    Participant
    Master

    Nicolas the code for the 3 trades works, but unfortunately the entry conditions after the 1 trade no longer work. Entry should only be if it goes over the High Line or under the Low Line. If I use crosses over / under it only starts with the next candle. Do you have a solution?

    Thank you

    once Bars=60         
    once Hi=0
    once Lo=0
    If time = 090000 then           
    Hi=highest[Bars](high)
    Lo=lowest[Bars](low)
    endif
    
    Spannepoints=(Hi-Lo)/pointsize  
    MaxBox = MB  
    
    if intradaybarindex=0 or day<>day[1] then
    count=0
    endif
     
    if  ( (not onmarket and onmarket[1] and not onmarket[2]) or (tradeindex(1)=tradeindex(2) and tradeindex(1)=barindex[1] and tradeindex(1)>0) or (not onmarket and onmarket[1]))   then
    count=count+1
    endif
     
    If not onmarket and time>= Startzeit and time < Endzeit and count<3  and Spannepoints < MaxBox  then
    BUY Position Lot AT Hi+(Spread/2) Stop
    Sellshort Position Lot AT Lo-(Spread/2) Stop
    
    ENDIF
     
    // Stops und Targets
    SET STOP pLOSS Spannepoints*y
    SET TARGET pPROFIT Spannepoints *x
    
Viewing 15 posts - 1 through 15 (of 17 total)
  • You must be logged in to reply to this topic.

3 trades per day


ProOrder support

New Reply
Author
author-avatar
Razz @razz Participant
Summary

This topic contains 16 replies,
has 5 voices, and was last updated by Razz
6 years, 1 month ago.

Topic Details
Forum: ProOrder support
Language: English
Started: 12/17/2019
Status: Active
Attachments: 5 files
Logo Logo
Loading...