Only one trade per day
Forums › ProRealTime English forum › ProOrder support › Only one trade per day
- This topic has 10 replies, 5 voices, and was last updated 5 months ago by iococcobill.
Tagged: otd
-
-
10/19/2023 at 6:04 PM #22265810/19/2023 at 6:26 PM #222663
As posted in https://www.prorealcode.com/topic/help-with-limiting-strategy-to-one-trade-per-day/#post-143705, you can use
1OTD = Barindex - TradeIndex(1) > IntradayBarIndexthen you can add OTD to your entry conditions, like the example in the link above.
1 user thanked author for this post.
10/20/2023 at 7:37 AM #22267610/20/2023 at 11:26 AM #22268310/20/2023 at 6:55 PM #222703These 2 snippets seem to work as expected (one uses OTD, the other one doesn’t):
n. 1123456789DEFPARAM CumulateOrders = FalseOTD = Barindex - TradeIndex(1) > IntradayBarIndexBulls = summation[3](close >= open) = 3Bears = summation[3](close <= open) = 3IF Bulls AND Bears[3] AND Not OnMarket AND OTD THENBUY AT MARKETENDIFSET TARGET pPROFIT 6SET STOP pLOSS 6n. 212345678DEFPARAM CumulateOrders = FalseBulls = summation[3](close >= open) = 3Bears = summation[3](close <= open) = 3IF Bulls AND Bears[3] AND Not OnMarket THENBUY AT MARKETENDIFSET TARGET pPROFIT 6SET STOP pLOSS 6anyway, I’ll keep testing them next Monday.
10/21/2023 at 10:13 AM #222717Hi @897148
Note that the TradeIndex(1) gives both a value when a position is opened and also when a position is closed…
With “If OnMarket and OTD” you know that a position was opened yesterday (or earlier) that is currently still open…
With “If NOT OnMarket and OTD” you know that a position was closed yesterday (or earlier) and that a position can now be opened again…
As Roberto also points out, use the OTD in combination with NOT OnMarket….
If Conditions and NOT OnMarket and OTD then
“Buy or SellShort”
…
1 user thanked author for this post.
10/23/2023 at 1:38 PM #222823My two snippets work correctly, the one using OTD opens only 1 trade per day, while the other one opens tens of trades.
1 user thanked author for this post.
10/23/2023 at 5:39 PM #222846I need to give a very big thankyou to Roberto and JS.
The OTD and Not OnMarket worked perfectly today when I ran live along with the original, multi trade version which took two trades in the allocated time but OTD only one as desired.
I still find it hard to believe how helpful some people are. Restores some much needed faith in mankind .
2 users thanked author for this post.
05/12/2024 at 12:20 PM #2325781 Long and 1 Short123456789101112OTD = Barindex - TradeIndex(1) > IntradayBarIndexIf myConditions AND NOT onmarket ThenIf marketposition < 1 AND OTD ThenBUY AT MARKETmarketposition = 1EndIfIf marketposition > -1 AND OTD ThenSELLSHORT AT MARKETmarketposition = -1EndIfEndIfHi, I’ve used this old post to solve the problem of not having more than one trade on the same day, unfortunately, I still could have one trade long and another one short, can you suggest to me how to solve that? Many thanks for considering my request.
Stefano05/12/2024 at 12:42 PM #232579and like this
123456789101112if IntradayBarIndex =0 THENNBtrade=0ENDIFif (longonmarket[1]=0 and longonmarket )or(SHORTONMARKET[1]=0 and SHORTONMARKET )THENNBtrade=1endifif condition and nbtrade<1 THENbuy 1 CONTRACTS AT MARKETENDIFif condition and nbtrade<1 THENSELLSHORT 1 CONTRACTS AT MARKETendif1 user thanked author for this post.
05/12/2024 at 5:47 PM #232585 -
AuthorPosts
Find exclusive trading pro-tools on