Can I buy at the high?
Forums › ProRealTime English forum › ProOrder support › Can I buy at the high?
- This topic has 20 replies, 8 voices, and was last updated 6 years ago by mr blue.
-
-
01/12/2018 at 10:41 AM #59150
Hi. I want to trade the major indices with the following condition. Assume c1 is the condition for a long trade. If c1, then enter a long trade if a following bar crosses over the high of the signal bar. The entry level should be the high of the signal bar (not the next market open). The order should be valid for x bars after the signal bar. The profit limit is the close of the signal bar plus the ATR and the stop loss is the close of the signal bar minus the ATR.
01/12/2018 at 10:52 AM #59153Hi Paulon, as a start, check out this link :
https://www.prorealcode.com/topic/customized-crasy-oscillator-needed-please/
More experienced coder might jump in this tread soon 😉
Thx
1 user thanked author for this post.
01/12/2018 at 10:52 AM #59154Yes. Just use:
123BUY ? Contracts AT High STOPSELL AT (close + AverageTrueRange[?]) LIMITSELL AT (close - AverageTrueRange[?]) STOPObviously replace the ? with your values. You will have to set these instructions at the close of every bar that you want the instruction to last for as they only last for one bar and are then cancelled.
1 user thanked author for this post.
01/12/2018 at 6:40 PM #59246Hi. I want to trade the major indices with the following condition. Assume c1 is the condition for a long trade. If c1, then enter a long trade if a following bar crosses over the high of the signal bar. The entry level should be the high of the signal bar (not the next market open). The order should be valid for x bars after the signal bar. The profit limit is the close of the signal bar plus the ATR and the stop loss is the close of the signal bar minus the ATR.
By no means you (and anyone else) may access future data. So you’ll have to modify your sentence to the past: “Assume c1[1] is the condition for a long trade, then enter a long trade if THIS bar crosses over the high of the signal (previous) bar. i.e. HIGH[1]”.
1 user thanked author for this post.
01/12/2018 at 7:28 PM #5925901/13/2018 at 11:25 AM #5932701/13/2018 at 12:49 PM #59336I picked up the original idea, looked for a profitable timeframe on the DAX and added one additional condition, that the market must be “risk on” – otherwise it will not buy.
0-dax-higher-high-4h-public1234567891011121314151617181920212223defparam cumulateorders = falseHt = DHigh(1)Bs = DLow(1)C = DClose(1)Pivot = (Ht + Bs + C) / 3//Res4 = Pivot + ((Ht - Bs)*3)//Res3 = Pivot + ((Ht - Bs)*2)//Res2 = Pivot + Ht - BsRes1 = (2 * Pivot) - Bs//Sup1 = (2 * Pivot) - Ht//Sup2 = Pivot - (Ht - Bs)//Sup3 = Pivot - ((Ht - Bs)*2)//Sup4 = Pivot - ((Ht - Bs)*3)if close > Res1 thenBUY 1 Contracts AT High STOPSELL AT (close + AverageTrueRange[9]) LIMITSELL AT (close - AverageTrueRange[9]) STOPendifUsing this source version you get the following results backtested (profit chart RED) … of course I investigated a bit more in this approach and the current result of the – not yet shared code – is the GREEN profit chart. Trading with fix 1 lot on the 1 EURO DAX CFD. Using a re-invest rule the profit rocks up > 25K in the same period of time.
I would be thrilled to see your version of the code beating the results of the RED and GREEN version. Let’s do a little competition here 🙂
PS: The green one will be shared later …
01/13/2018 at 2:53 PM #59351I have 27379 EUR… 10.000 bars (starting from October 1st 2013)
Signal taken from the post #59336
Code will be shared later 😉 I would be happy to see so other tentatives once I’ll be back from the soccer field … 😉
1 user thanked author for this post.
01/13/2018 at 3:44 PM #5936201/13/2018 at 7:25 PM #59373I have 27379 EUR… 10.000 bars (starting from October 1st 2013) Signal taken from the post #59336 Code will be shared later I would be happy to see so other tentatives once I’ll be back from the soccer field …
Thanks for posting your results. How does the result look like with only 1 LOT ?
01/13/2018 at 7:57 PM #5937701/13/2018 at 8:05 PM #5938001/14/2018 at 6:50 AM #5940001/14/2018 at 7:43 AM #5940101/14/2018 at 11:34 AM #59415Thanks for posting your results. How does the result look like with only 1 LOT ?
Not much better than buy and hold, I fear…
It works because there is a bull market. You could as well buy every day, or once a week, or once a month.
Buying at intermediate lows instead would increase performance somewhat, I think.
-
AuthorPosts
Find exclusive trading pro-tools on