Forums › ProRealTime English forum › ProOrder support › Automated trading with Pivot Points and Dojis › Reply To: Automated trading with Pivot Points and Dojis
05/24/2018 at 4:17 PM
#71259
Once again, when I use the following code with the euro dollar mini chart, the trade does not close when a new lower low forms. This exact code is working at different markets, like DAX or DOW JONES. The picture shows thursday 20.07.2017, and I backtested 100000 units.
Do I have to consider something special when using the euro dollar mini chart? Thank you!:)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 |
// EURO DOLLAR MINI 15 min DEFPARAM CumulateOrders = false DEFPARAM FlatBefore = 000000 DEFPARAM FlatAfter = 234500 if OpenDayOfWeek = 1 then Pivot = (DHigh(2) + DLow(2) + DClose(2)) / 3 //R1 = 2*Pivot - DLow(2) //S1 = 2*Pivot - DHigh(2) //rR2 = Pivot + (DHigh(2) - DLow(2)) S2 = Pivot - (DHigh(2) - DLow(2)) //R3 = R1 + (DHigh(2) - DLow(2)) //S3 = S1 - (DHigh(2) - DLow(2)) endif if OpenDayOfWeek = 2 then Pivot = (DHigh(1) + DLow(1) + DClose(1)) / 3 //R1 = 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)) endif if OpenDayOfWeek = 3 then Pivot = (DHigh(1) + DLow(1) + DClose(1)) / 3 //R1 = 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)) endif if OpenDayOfWeek = 4 then Pivot = (DHigh(1) + DLow(1) + DClose(1)) / 3 //R1 = 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)) endif if OpenDayOfWeek = 5 then Pivot = (DHigh(1) + DLow(1) + DClose(1)) / 3 //R1 = 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)) endif dojisizes2d = 10 dojis2d = Range >= ABS(Open[1] - Close[1]) * dojisizes2d bullishs2d = (dojis2d and low[1] <= s2+abstl2d and low[1] >= s2-abst2d and close>high[1] and low>low[1]) abst2d = 8*pipsize abstl2d = 2*pipsize size = 4 if bullishs2d then ldbs2d = low[1]-2 Buy size Contract at Market endif if longonmarket and ldbs2d then sell at ldbs2d stop endif if longonmarket and (close <low[1]) then sell at market endif |