Previous weeks high and low price level
Forums › ProRealTime English forum › ProBuilder support › Previous weeks high and low price level
- This topic has 5 replies, 3 voices, and was last updated 11 months ago by phoentzs.
06/20/2022 at 5:58 PM #195672
Can somebody help me with this. I am trying to return a Donchian like indicator that shows a channel with the last weeks high and low overlaid on a daily chart. Not a Donchian because I want the price levels for the previous week to stick for the entire current week before updating on the Monday.
This is what I have tried but it doesn’t work, but I don’t know why. Apologies in advance for the basic question.1234Timeframe(1 Week)Upper = highest(high)Lower = lowest (low)return Upper,lower06/20/2022 at 7:23 PM #19567706/20/2022 at 10:05 PM #195681Previous High Low System123456789101112131415161718192021DefParam CumulateOrders = FalseTimeFrame(1 week, UpdateOnClose)Upper = Highest(High)Lower = Lowest(Low)TimeFrame(daily)PositionSize = STRATEGYPROFIT / (Close * MargePerc)If PositionSize < MinPosition thenPositionSize = MinPositionEndIfIf PositionSize > MaxPosition thenPositionSize = MaxPositionEndIfIf close > Upper[xL] thenBuy PositionSize contract at marketElsIf Close < Lower[xS] thenSellShort PositionSize contract at marketEndIf
These kinds of simple systems where you compare the Close with a previous value, usually score well, both on robustness and performance…06/21/2022 at 4:55 PM #195772
Thank you JS!
I understand the UpdateOnClose now, and thank you for the system example. I am trying to develop a couple of super simple strategies along these lines. However simple ideas turn into complex code!
Just starting out so every answer brings another question at the moment. Apologies.
When I try and replicate your system I get nothing like your equity curve. Can you explain what the [xL] and [xS] are referring to.
I think I understand the Money Mment but what is MargePerc06/21/2022 at 5:45 PM #195777
xL (xLong) and xS (xShort) are the parameter I used to optimize.
I think I had xL and xS optimized from 0 to 100 (step 5).
MargePerc is Margin Percentage for example Dow Jones is MargePerc = 0.05 (5%)
I will try to add the code as itf -file06/22/2022 at 10:05 AM #195825
Find exclusive trading pro-tools on