Multiple strategies in one strategy.
Forums › ProRealTime English forum › ProOrder support › Multiple strategies in one strategy.
- This topic has 27 replies, 8 voices, and was last updated 1 month ago by GraHal.
-
-
11/11/2020 at 7:51 PM #150182
I don’t think my coding idea can work with STOP orders and Renko bricks. With Renko brick sizes you would simply always be placing a STOP order at the closest level for the smallest brick.
1 user thanked author for this post.
09/19/2024 at 2:03 PM #237820Hi all,
I have read this thread with great interest, but unfortunately, I can’t find exactly what I’m looking for. I have three strategies, A, B, and C, which are quite similar. I want up to two of the strategies to be able to take a position but not all three at the same time (as it would result in too big exposure). Does anyone know how this can be solved?
09/19/2024 at 2:14 PM #237821Hi. Try this
Mods edit: link edited out
2 trades, CUMULATEORDERS = true123456789101112131415161718DEFPARAM CUMULATEORDERS = trueonce trade=0IF YourTradeIdeaA and trade<=2 THENBUY PositionSize CONTRACT AT MARKETtrade=1ENDIFIF YourTradeIdeaB and trade<=2 THENBUY PositionSize CONTRACT AT MARKETtrade=1ENDIFIF YourTradeIdeaC and trade<=2 THENBUY PositionSize CONTRACT AT MARKETtrade=1ENDIF
09/19/2024 at 5:49 PM #23783409/19/2024 at 5:56 PM #237835Hi,
To count the number of transactions use:
Trade=Trade+1
2 users thanked author for this post.
09/19/2024 at 7:13 PM #237839Thank you so much, ProfitAlgos. This solved the entire challenge!👍🎯
1 user thanked author for this post.
09/19/2024 at 7:33 PM #237841Moderation point: please don’t add link to a marketplace product in a proorder topic when it’s irrelevant to the topic, keep such links to relevant store dedicated topic in the “general trading discussions”, thanks. Link has been edited out.
1 user thanked author for this post.
09/19/2024 at 7:49 PM #237842Glad, it worked out for you 😊
09/19/2024 at 8:19 PM #237846Hmmm… that was probably a bit of a hasty judgment on my part. I also tried to include Trade=Trade+1 to count the number of transactions, as JS suggests, but then it doesn’t take a position. Should Trade=Trade+1 replace Trade=1, or how should the script look?
09/19/2024 at 8:50 PM #23784809/20/2024 at 11:33 AM #237872Like this
trade+1123456789101112131415161718DEFPARAM CUMULATEORDERS = trueonce trade=0IF YourTradeIdeaA and trade<=2 THENBUY PositionSize CONTRACT AT MARKETtrade=trade+1ENDIFIF YourTradeIdeaB and trade<=2 THENBUY PositionSize CONTRACT AT MARKETtrade=trade+1ENDIFIF YourTradeIdeaC and trade<=2 THENBUY PositionSize CONTRACT AT MARKETtrade=trade+1ENDIF10/23/2024 at 10:47 PM #239386Thanks to those who have provided comments and scripts on how to combine multiple strategies into one. It works well and is very useful!
An even better solution might be if each strategy could be started separately (as standalone strategies instead of all being combined into one), otherwise, you would have to stop all of them if you want to make a change to one of the strategies. Does anyone know if it’s possible to add to each strategy’s script that it should go long if the number of long contracts on my account is a maximum of x, and otherwise not?
10/24/2024 at 8:47 AM #239390 -
AuthorPosts
Find exclusive trading pro-tools on