Doubts with cumulateorders = true
Forums › ProRealTime English forum › ProOrder support › Doubts with cumulateorders = true
- This topic has 12 replies, 3 voices, and was last updated 5 years ago by
Fran55.
-
-
08/23/2020 at 5:48 PM #142367Doubts with cumulateorders = true.
- Lets start by the beginning.
- Can you have several positions with different stop and profit for each position?
- How to program that the first position enters with conditions, stop 1.5% and profit 3%, and places breakeven when it gains 0.5%, and then, when the first position places breakeven, that the second position enters without conditions and without affecting to the breakeven of the first position. For the second position the stop would be 2% and the profit 2.5%. There could be a third position, when the second position rises 0.5% and breakeven, its stop would be 2.5% and its profit 2%.
Can this be done?08/23/2020 at 6:27 PM #142372Always use the ‘Insert PRT Code’ button when putting code in your posts, not when writing TEXT.
- Lets start by the beginning.
I agree with this
- Can you have several positions with different stop and profit for each position?
No, you can accumulate more than one position, but there is only one SL and only one TP
- How to program that the first position enters with conditions, stop 1.5% and profit 3%, and places breakeven when it gains 0.5%, and then, when the first position places breakeven, that the second position enters without conditions and without affecting to the breakeven of the first position. For the second position the stop would be 2% and the profit 2.5%. There could be a third position, when the second position rises 0.5% and breakeven, its stop would be 2.5% and its profit 2%.
It can’t be done due to my answer to point 2.
08/23/2020 at 7:45 PM #142375OK Roberto, thanks for your answer …
So I understand that several positions add up to a single position.
Which brings me inevitably to the next question.If there is only one position, the stop would be 1.5% and 3% profit and its breakeven would be placed when it gains 0.5%.
If another position enters, stop, profit and breakeven are canceled … but I understand that the stop could be 3%, profit 6% and the breakeven would be placed when it gains 1%.
And if a third position enters, all of the above would be canceled, and we could put a 4.5% stop, 9% profit, and 1.5% to place the breakeven.In this way we could have similar conditions, regardless of how many positions there are, despite the circumstances
Can this be done ??? … or something like that ???
Please!!!
08/23/2020 at 8:23 PM #142377When you add a position the tradeprice becomes POSITIONPRICE, which is an average of all entry prices multiplied by the number of lots.
Do the SL & TP are updated accordingly.
Percentages will reamain the same, just calculated on a different average price. https://www.prorealcode.com/documentation/positionprice/
08/23/2020 at 9:56 PM #142379OKAY.
I have elaborated all this code but there is something that escapes me.
Up to € 21,000 of strategyprofit there can only be one position and up to € 10 of position.
Between € 21,000 and € 28,000 of stategyprofit there may be one or two positions, both of € 10 each … that is, € 20 maximum total position.
More than 28000 of strategy profit there can be one, two, or three positions, of € 10 each … that is, € 30 maximum total position.1234567891011121314151617181920212223242526272829303132333435363738394041424344//Tamaño, Profit y Stop de la posicionIF CONDBUY and Strategyprofit <= 21000 and count<maxorders1 THENONCE Positionsize = 0.5buy positionsize contract at marketSET TARGET %PROFIT 2.1SET STOP %LOSS 1.5ENDIFIF CONDBUY and Strategyprofit >= 21000 and Strategyprofit <= 28000 and count<maxorders1 THENONCE Positionsize = 10buy positionsize contract at marketSET TARGET %PROFIT 2.1SET STOP %LOSS 1.5ENDIFIF CONDBUY and Strategyprofit >= 21000 and Strategyprofit <= 28000 and count<maxorders2 THENONCE Positionsize = 10buy positionsize contract at marketSET TARGET %PROFIT 4.2SET STOP %LOSS 3ENDIFIF CONDBUY and Strategyprofit >= 28000 and count<maxorders1 THENONCE Positionsize = 10buy positionsize contract at marketSET TARGET %PROFIT 2.1SET STOP %LOSS 1.5ENDIFIF CONDBUY and Strategyprofit >= 28000 and count<maxorders2 THENONCE Positionsize = 10buy positionsize contract at marketSET TARGET %PROFIT 4.2SET STOP %LOSS 3ENDIFIF CONDBUY and Strategyprofit >= 28000 and count<maxorders3 THENONCE Positionsize = 10buy positionsize contract at marketSET TARGET %PROFIT 6.3SET STOP %LOSS 4.5ENDIF<span class="tlid-translation translation" lang="en"><span class="" title="">There is a first part that does it well, but then, as seen in the photos, it buys positions of € 20 and € 30, but they should all be € 10</span></span>08/23/2020 at 10:17 PM #142387ONCE means ONLY ONE TIME, so they will only be read ONCE on the very first bar.
Remove the word ONCE.
08/23/2020 at 10:19 PM #14238808/24/2020 at 8:54 AM #14240008/24/2020 at 9:14 AM #14240608/24/2020 at 9:23 AM #142409We need:
- to know what is the issue you are talking about
- full code
because part of the code you post rely on other parts.
08/25/2020 at 11:55 PM #14256208/26/2020 at 1:55 AM #142563If you want all operations to be 10, just use only one SL and TP set with 10 pips, instead of a percentage.
08/26/2020 at 8:20 AM #142566 -
AuthorPosts
