by Silverthorn » Tue Jan 02, 2018 12:38 am
Hi Apprentice,
Thank you for your help.
At first the Strategy behaved very strangely. I eventually figured out that the shift on the MA was 2 periods not 1.
I found the lines
upper_band = core.indicators:create("SHIFT_MA", ha_ask.high, instance.parameters.N, instance.parameters.MA, 1, instance.parameters.SY);
lower_band = core.indicators:create("SHIFT_MA", ha_bid.low, instance.parameters.N, instance.parameters.MA, 1, -instance.parameters.SY);
centre_band_bid = core.indicators:create("SHIFT_MA", ha_bid.open, instance.parameters.N, instance.parameters.MA, 1, 0);
centre_band_ask = core.indicators:create("SHIFT_MA", ha_ask.open, instance.parameters.N, instance.parameters.MA, 1, 0);
and changed to
upper_band = core.indicators:create("SHIFT_MA", ha_ask.high, instance.parameters.N, instance.parameters.MA, 0, instance.parameters.SY);
lower_band = core.indicators:create("SHIFT_MA", ha_bid.low, instance.parameters.N, instance.parameters.MA, 0, -instance.parameters.SY);
centre_band_bid = core.indicators:create("SHIFT_MA", ha_bid.open, instance.parameters.N, instance.parameters.MA, 0, 0);
centre_band_ask = core.indicators:create("SHIFT_MA", ha_ask.open, instance.parameters.N, instance.parameters.MA, 0, 0);
That gives an offset of one candle as required but I'm sure that is not the correct way to fix the problem. It did allow me to run the strategy in simulator to test.
I then saw that the pending stop losses are placed at the centre band instead on the opposite band. I had originally requested that the stop be placed on the opposing band and moved to the centre band on the next candle but now realise that that is way too soon and causes a lot of stop outs. This is a manual trading system that I have used successfully for some time now. However the timing of when I move from the outer band to the centre band is something I use my own judgement on so it may need some tweaking.
Can I please have the pending stop loss placed on the opposite outer band on creation and then move up with the opposing outer band until the stop loss is above the trade entry/ break even point. At that time the stop loss should follow the centre band.
Lastly this is not a strategy that is set and forget. The timing is based on top down and bottom up analysis. I originally thought that being able to set trading to long or short only would suffice. I now realise that it would be a big advantage to be able to force a trade open and then let the strategy manage it from there. Is it possible to have a pair of buttons on the screen that would allow me to open trades manually and then allow the strategy to manage the trades from there?
Thanks again for your awesome work.
Cheers.