Donchian Stop Loss
Forums › ProRealTime English forum › ProOrder support › Donchian Stop Loss
- This topic has 28 replies, 3 voices, and was last updated 7 years ago by Mark.
-
-
09/13/2016 at 8:44 PM #13038
I have tried to set this up for automatic trading, and I get this error:
The following changes must be applied before sending the code to ProOrder :
– Trading systems with orders that partially close a position cannot be sent to ProOrder (ex: SELL 3 SHARES AT MARKET). Make sure that no quantity is specified in instructions to close positions (in this case, the instruction closes the entire position). Ex:
SELL AT MARKET
EXITSHORT AT 1.5 LIMIT09/14/2016 at 7:53 AM #1305209/14/2016 at 10:20 AM #1305809/14/2016 at 12:57 PM #13075So don’t use any count number of shares when you want to close a position, use SELL AT MARKET and EXITSHORT AT MARKET instead.
Partial close works in paper trading, I hope to see it working too in live trading soon.. or later..
09/14/2016 at 1:17 PM #1308009/14/2016 at 3:31 PM #1309509/14/2016 at 4:38 PM #13098Yes – as far as I can tell it’s mainly an issue where I was flat over night.
At the moment I’m saying “if not onmarket and fastMA>slowMA go long”, but that’s not true – I might have closed a long position the night before and there’s been no crosseover to make me go long against. What I want it to do is check whether at 9pm fast MA<slowMA, and has now risen above it, then go long.
Opposite with short.
09/15/2016 at 10:07 AM #13124I think you should clean up the code first. Because you have used the “simplified creation” system, some variables are repeated twice (moving average) and that is a mess to debug it 🙂
It don’t needs to have the same moving average to be declared more than one time, so when you are making your conditionals statements, you may have type the wrong MA variables names (indicatorX).. You should also named them : “SlowMA”, “FastMA”, etc.
Then, about the 7am trades, you can easily debug it with only testing one condition at a time. Firstly, test “//close long”, if it’s ok test “//close long and go short”, etc.
09/15/2016 at 12:53 PM #1312810/10/2016 at 10:13 AM #14564Hi Nicolas,
I’ve been trialling the system on a demo account for a couple of weeks, and it’s mainly performing as I would expect.
However, there are times when it’s not doing what I want it to – for example when I have a ‘close call’ where the moving averages crosses in one bar, but then goes back the other way in the next bar. In real life I wouldn’t take the trade (or close the trade), but the system is.
What I want the system to do is “if the previous candle saw a cross, AND this candle sees the MA stays over/under, then take the trade at the close of the 2nd candle”.
Here is my code for a long example:
123456789101112131415161718192021222324// Conditions to enter long positionsindicator1 = ExponentialAverage[x](close)indicator2 = ExponentialAverage[z](close)c1 = (indicator1 CROSSES OVER indicator2)indicator3 = ExponentialAverage[x](close)indicator4 = ExponentialAverage[z](close)c2 = (indicator3 > indicator4)IF c1 AND c2 THENBUY positionsize PERPOINT AT MARKETENDIF// Conditions to exit long positionsindicator5 = ExponentialAverage[x](close[1])indicator6 = ExponentialAverage[y](close[1])c3 = (indicator5 CROSSES UNDER indicator6)indicator7 = ExponentialAverage[x](close)indicator8 = ExponentialAverage[y](close)c4 = (indicator7 < indicator8)IF c3 AND c4 THENSELL AT MARKETAttached is a screenshot from this morning, where a short position was closed due to the fast MA crossing over the middle MA – but each time it dropped back down below in the next bar (so I wouldn’t exit the short position).
Can you help?
10/10/2016 at 11:02 AM #1457010/10/2016 at 1:01 PM #14578Yes, whether it’s long or short, and whether it’s entering a new trade or closing one.
For example, if using 10 minute candles – if during the 7am candle the fast MA crosses over the slow MA, and at the end of the 7.10 candle it’s still above it – open a new long position. If it crosses over, but falls back below, no trade.
10/14/2016 at 9:09 AM #14886Hi Nicolas,
I have seen another great example this morning – where a new long position was closed and reversed to a short position when it shouldn’t have.
Attached are the 10 minute candles, the blue circles are where trades were taken, and the red circle is where the trade would have been (if I were trading manually).
It makes a big difference, especially in a volatile open like today!
01/30/2017 at 9:19 PM #23164Hi prolfs,
just been reading through your posts. It looks like I manually trade a very similar system to you, did you happen to learnt it from an online course? (Could be the same one) I have also been trying to code the system but my results so far have been way off my manual results.
mark
-
AuthorPosts
Find exclusive trading pro-tools on