Automated trading with Pivot Points and Dojis
Forums › ProRealTime English forum › ProOrder support › Automated trading with Pivot Points and Dojis
- This topic has 84 replies, 5 voices, and was last updated 6 years ago by robertogozzi.
Tagged: candlestick pattern, doji, pivot points
-
-
05/13/2018 at 2:16 PM #7029905/13/2018 at 2:47 PM #70301
Ha, nice one! language barrier again! 🙂
So next we need to determine if …
Piv D/T is todays / current day H+L+C/3 and so Piv changes as the day’s price moves on?
OR or as you have coded in your System
Pivot = (DHigh(1) + DLow(1) + DClose(1)) / 3 … which is yesterday’s price levels??
1 user thanked author for this post.
05/13/2018 at 2:52 PM #7030205/13/2018 at 5:40 PM #70310I change to code from “set target” to “exitshort” and “low crosses under pivot”. However, this is not exactly as I planned, because now the exit is triggered not immediatly but rather at the open of the new candle.
1234IF shortonmarket and low crosses under pivot thenexitshort size contract at marketENDIFSo apparently the Pivot lines must be identically with the Pivot lines from the chart since the exit is triggered as you can see in the picture.
Last but not least there is still the problem with the range. The program does not seem to recognise that condition.
05/13/2018 at 7:51 PM #70313now the exit is triggered not immediatly but rather at the open of the new candle
I’ve been out for a family meal so coming at with a fresh mind, what happens if you try …
1234If bearishr1 ThenSellShort size Contract at MarketExitshort at pivot stopEndif1 user thanked author for this post.
05/13/2018 at 10:27 PM #70316This did not change that much. But I figured out, that the system is better off without any stops at the pivot lines. So right now I let it roll until a candle with higher highs or lower lows develops;)
Do you have any idea what we can do about the entry within the range of +- 4 points to the pivot lines?
05/14/2018 at 7:29 AM #70328dojisize = 4.2*pipsize
doji = Range >= ABS(Open[1] – Close[1]) * dojisize
What Market are you trading on? (good to name the market at top of your code, then easy to find) Try *pipsize as above?
Also enter GRAPH Range >= ABS(Open[1] – Close[1]) * dojisize at the bottom of yuor code and then backtest.
How many times do you see Range >= ABS(Open[1] – Close[1]) * dojisize during the backtest period??
05/14/2018 at 11:47 AM #7034405/14/2018 at 12:14 PM #70346Try
GRAPH (close[1] <= r1+4 and close[1] >= r1–4) and close<low[1])
and where that lines up with
GRAPH Range >= ABS(Open[1] – Close[1]) * dojisize
then you have all conditions to trigger a SellShort = TRUE. Does that equal 9 times?
05/14/2018 at 12:37 PM #7034805/14/2018 at 12:52 PM #7035005/14/2018 at 1:29 PM #70357This worked. I graphed all Pivot lines and there seems to be an issue with the timeframe. For instance look at the picture. It says, that the doji was developed within the range of the R3 line, but the R3 line is way too far away. What could be the reason for this?
05/14/2018 at 2:55 PM #7037405/14/2018 at 2:56 PM #70375Ok, I aligned the two time frames. I created an indicator with the pivot lines and displayed them into the chart. As you can see they are now equal. But I changed my prefered Pivot point settings. I want the pivot points only to consider a daily time frame from the opening at 9:00 till the closing at 17:30. How can I change the settings within the code so the pivot points only considere this time frame?
05/14/2018 at 3:00 PM #703771234567891011121314151617181920212223242526272829303132333435363738394041424344454647//DAXDEFPARAM CumulateOrders = falseDEFPARAM FlatBefore = 090000DEFPARAM FlatAfter = 171500Pivot = (DHigh(1) + DLow(1) + DClose(1)) / 3R1 = 2*Pivot - DLow(1)S1 = 2*Pivot - DHigh(1)rR2 = Pivot + (DHigh(1) - DLow(1))S2 = Pivot - (DHigh(1) - DLow(1))R3 = R1 + (DHigh(1) - DLow(1))S3 = S1 - (DHigh(1) - DLow(1))dojisize = 4.2doji = Range >= ABS(Open[1] - Close[1]) * dojisizebearishr1 = (doji and (close[1] <= r1+4 and close[1] >= r1-4) and close<low[1])stoplownextcandle = low<low[1]stoplowdoji = low>low[1]stophighdoji = high<high[1]stophighnextcandle = high>high[1]size = 30stopbull = 2stopbear = 2If bearishr1 ThenSellShort size Contract at MarketEndifif shortonmarket and stophighnextcandle thenset stop ploss (high+stopbear)endifif shortonmarket and stophighdoji thenset stop ploss (high[1]+stopbear)endifIF shortonmarket and (close >high[1]) thenexitshort size contract at marketENDIFHere is the current code with the R1 line as an example.
-
AuthorPosts
Find exclusive trading pro-tools on