Is this performance chart of this strategy look good?
Forums › ProRealTime English forum › ProOrder support › Is this performance chart of this strategy look good?
- This topic has 48 replies, 9 voices, and was last updated 1 week ago by justisan.
-
-
10/29/2024 at 6:18 PM #239744
If I interpret it correctly, it is possible a kind of Martingale system where you increase your position after a loss?
Yes, WingYip can hopefully confirm that he buys extra after a loss – I read that too but it could be a typo.
Btw, this is not necessarily Martingale as I just typed a post for this thread (not posted) where I kind of see and show the similarities with what I do myself, and this includes increasing after a loss – and NOT after a win. And this is not a Martingale system at all.
So WingYip – curious ! 🙂
To me the only reason to buy extra when loss is only to find the best reason to reinvest the reasonable little to make the system can carry on reinvest, nothing special, it could add the extra when you win, but in my case, if add extra when win then the system will fail very quickly because it will adding too many or say reinvest too many without blance, so it is just to find the best excuse to reinvest when the system earn, that’s all. Example it can be anything such as when xyz happen then add %. etc. Otherwise just use the none MM vision.
1 user thanked author for this post.
10/29/2024 at 6:38 PM #23974510/29/2024 at 6:54 PM #23974710/29/2024 at 7:03 PM #239748To me the only reason to buy extra when loss is only to find the best reason to reinvest the reasonable little to make the system can carry on reinvest, nothing special, it could add the extra when you win, but in my case, if add extra when win then the system will fail very quickly because it will adding too many or say reinvest too many without blance,
Exactly that.
(I am reluctant to post my posting because I don’t want to distract from your great stuff)
And thank you for being and sharing a great mind.10/31/2024 at 8:32 PM #239840as long as the core system is a overall winner, the money management is a bonus, you can add this code to make sure the system never invest more than your capital, so the system would never stop just because of not enough fund, but again it only base on the core system is a overall “winner”. the leverage 20 is only for IG/ NASDAQ, you need to use the correct leverage for others.
not a great help compere to all others in here.12345678910111213once capital = 88888// Update capital after each trade based on last trade performanceif strategyprofit <> strategyprofit[1] thencapital = capital + (positionperf(1) * positionsize)endif// Calculate the maximum allowable position size based on capital, close price, and leveragemaxPositionSize = capital / (close / 20) // Correctly applying leverage// Ensure position size does not exceed available capitalif positionsize > maxPositionSize thenpositionsize = maxPositionSize * 0.99 // Limit position size to 99% of maximum allowable sizeENDIF1 user thanked author for this post.
10/31/2024 at 11:02 PM #239841Hi @WingYip
“PositionPerf(n)” is a ratio between the return of the position and its purchase cost. To convert “PositionPerf(n)” into a cash value, you need to multiply it by the purchase price (PositionPrice[n])…
When you further multiply by “PositionSize,” keep in mind that this calculation refers to a closed position. Currently, “PositionSize” is either zero (Not OnMarket) or corresponds to a newly opened position, but it is never equal to the previous (closed) position size…
10/31/2024 at 11:23 PM #239842Thank you for your comment, I could be incorrect that
PositionPrice(n)
is used to track profit or loss in absolute terms based on the specific entry price. However, if you only need the result in percentage terms and already havePositionPerf(n)
, thenPositionPrice(n)
is unnecessary, as you can simply usePositionPerf(n) * PositionSize
to get the cash value.
PositionSize would be whatever is in your code you set up + any money management to increases it. and this code is only for money management, therefore the PositionSize would never happen in zero (well, at less in my case), otherwise without money management, this code is unnecessary.10/31/2024 at 11:39 PM #23984310/31/2024 at 11:49 PM #23984410/31/2024 at 11:54 PM #239845for my understanding is that, let say the last trade open at 19876 and it close at 20123
To calculate
PositionPerf(1)
based on this example, let’s determine the performance of the position as a ratio.- Determine the Profit or Loss:
- Open Price: 19876
- Close Price: 20123
- Profit: Close Price – Open Price
Profit=20123−19876=247
- Calculate the PositionPerf(1):
PositionPerf(1)
is typically calculated as the profit (or loss) divided by the open price.
PositionPerf(1)=Profit/Open Price=247/19876=0.01242
- In percentage terms, this would be approximately 1.24%.
Summary:
PositionPerf(1)
for this trade would be about 0.01242, or 1.24%. This value reflects the return on the investment based on the opening price of the trade.- If multiply this by the
PositionSize
, you’ll get the cash amount earned from that trade.
So, in my code, using
PositionPerf(1) * PositionSize
should yield the correct cash value based on this performance ratio.11/01/2024 at 12:03 AM #23984611/01/2024 at 12:32 AM #23984711/01/2024 at 12:10 PM #239864JS is right, PositionPerf is just a multiplier of PositionPrice (to get the % you need to multiply it by 100). Multiply the result by PipValue to get the money gained/lost.
PositionPerf = (Close / PositionPrice) – 1, i.e. 1000 / 1010 gives 0.0990100 (i.e. 9.901%), then you have to multiply it by PipValue, because Close / PositionPrice is the same multiplier, say, for Dax €1, Dax €5 and Dax €25, what makes a difference is PipValue (the value of each Pip: 1, 5 or 25 euros).
11/01/2024 at 1:11 PM #239872this should work
12345678910once capital=8888if strategyprofit <> strategyprofit[1] thencapital = capital + (strategyprofit - strategyprofit[1])endif// Calculate the maximum allowable position size based on capital, close price, and leveragemaxPositionSize = capital / (close / 20) // Correctly applying leverage// Ensure position size does not exceed available capitalif positionsize >= maxPositionSize thenpositionsize = maxPositionSize * 0.99 // Limit position size to 99% of maximum allowable sizeENDIF11/01/2024 at 2:10 PM #239874StrategyProfit[1] is equal to the StrategyProfit of the previous BAR… (not the profit or loss of the previous closed position).
1 user thanked author for this post.
- Determine the Profit or Loss:
-
AuthorPosts
Find exclusive trading pro-tools on