Home › Forums › Trading System Mentor Course Community › AmiBroker Coding and AFL › Multiple Limit Buy Orders
- This topic is empty.
-
AuthorPosts
-
April 8, 2016 at 1:19 am #101471AnonymousInactive
Hi,
Just wondering if anyone has had a look at setting more than 1 limit buy order for mean reversion systems. As an example, instead of setting a limit buy 0.50 * ATR below the close, you might set 2 orders, the first 0.40* ATR and the second 0.60 * the ATR.
While this is not necessary now and it would increase trading costs and workload involved, I was just thinking about addressing liquidity.
Any help with how to code this would be awesome!!
Regards,
Oliver
April 8, 2016 at 3:42 am #103534Stephen JamesMemberdo mean to scale in Oliver? e.g. buy 50% of position at first limit, rest at second?
April 8, 2016 at 4:13 am #103541AnonymousInactiveHi Craig,
Yes indeed. I was reading up on the scale-in function, I am just not sure exactly how to put it into the code.
So if both limit buys are filled, you end up with an average entry at 0.5R (not accounting for brokerage), but a certain % of trades would only trigger the higher limit buy.
April 8, 2016 at 4:38 am #103542Stephen JamesMemberTry creating two entries in the looping, the second using sigscalein as the Buy.
I just did the example below on the fly – it may need some tweaking..
Code:for (j = 1; j < BarCount; j++) { if (LPriceAtBuy==0 AND LE[j]) { Buy[j] = True; LPriceAtBuy = LEPrice[j]; BuyPrice[j] = LEPrice[j]; LBIT[j] = 1; if (LPriceAtBuy==0 AND LE2[j]) { Buy[j] = SigScaleIn; BuyPrice[j] = LEPrice2[j]; } } //Then for position sizing something along these lines:- SetPositionSize( 50, spsPercentOfEquity ); SetPositionSize( 50, spsPercentOfPosition * ( Buy == sigScaleIn ) );April 8, 2016 at 5:04 am #103543AnonymousInactiveOk thanks Craig, Ill give it a go. Cheers
April 9, 2016 at 11:25 pm #103535ScottMcNabParticipantI’d like to hear how you go Oliver please if you get a chance to try it out….I’d also be interest if anyone has tried playing around with different exits based on changing market conditions too. I have wondered if a filter could be added such that the stop loss was tightened or loosened (eg depending if stock and/or index ADX or RSI rising/falling or the close in relation to HHV(H,20) etc) or the filter may trigger a different exit altogether (eg strongly strending market then exit1 = close>ref(c,-1) AND ref(c,-1)>ref(c,-2) …otherwise exit2 = close>ref(c,-1)….) or may scale out to take some profits earlier than would normally.
I hope to get around to trying this stuff out once have a system that passes paper trading… if happens I will post too.
Cheers
April 10, 2016 at 8:36 am #103536TrentRothallParticipantNot sure if you have read Nick’s weekend trend trader book but it uses a stop loss that tightens depending if the Index is up/down. If you have access to his new ‘Community” you can see it there.
April 10, 2016 at 8:55 am #103537ScottMcNabParticipantI thought I had all Nick’s books but apparently not. Is this contained within the Chartist community Trent ?
April 10, 2016 at 9:31 am #103538TrentRothallParticipantYeah it is there, i can show you the code for it or how i did it anyway if you like. I pinched his idea for the first system i was trying to develop.
April 10, 2016 at 9:08 pm #103539Nick RadgeKeymasterWe use an adaptive style exit on both the Weekend Trend Trader, the US Momentum and the Growth Portfolio and find it dramatically increases risk adjusted returns. We’re not doing anything overly complex though.
In the past the High Frequency Strategy uses adaptive entries; specifically we allowed more stretch depending on the strength of the market. When the market was trending very strongly we tightened the stretch up. When the broader market trend was sloppy and weak, we loosened the stretch.
We have since discarded that as it (a) wasn’t really adding a great deal of benefit, and (b) it was essentially more moving parts. We moved back to a single entry for robustness.
April 10, 2016 at 9:52 pm #103545AnonymousInactiveHi Scott,
Ill let you know how I go. I have had an attempt, but can’t seem to get the scalein to work as yet.
Regards
Oliver
April 10, 2016 at 10:50 pm #103540ScottMcNabParticipantI have a few hours spare today so I might try it using different exits for different conditions (rather than scaleout which I suspect is be beyond me)…interesting that it seems to work better for momentum verses MRV. Thanks for replies.
April 11, 2016 at 10:44 am #103546SaidBitarMemberScott McNab wrote:I’d like to hear how you go Oliver please if you get a chance to try it out….I’d also be interest if anyone has tried playing around with different exits based on changing market conditions too. I have wondered if a filter could be added such that the stop loss was tightened or loosened (eg depending if stock and/or index ADX or RSI rising/falling or the close in relation to HHV(H,20) etc) or the filter may trigger a different exit altogether (eg strongly strending market then exit1 = close>ref(c,-1) AND ref(c,-1)>ref(c,-2) …otherwise exit2 = close>ref(c,-1)….) or may scale out to take some profits earlier than would normally.I hope to get around to trying this stuff out once have a system that passes paper trading… if happens I will post too.
Cheers
Scale out i do not believe it will be good idea did not try it but because many of the winners are really small percentage wise and you will make them even smaller by adding more commissions to it i know 1$ is not much but on the long run maybe it will hurt. The idea of introducing two exits sounds nice especially when there is momentum in the stock it will not only close higher but will continue to go up for few days it will be very nice to capture this short move
like in this case instead of exit on 84.25$ you would have exited on 88.48$ that is 4.23$ additional per share
The way to test it is by introducing filter that is specific for the stock not the index because you do not care if the index is going up and your stock is going down
i will test the idea and give you feedback
April 11, 2016 at 10:57 am #103549SaidBitarMemberJust to explain from where i got the 88.48$ as exit in the previous example i assumed an exit when the stock stop making higher Highs and higher lows you exit on the open of the following day
April 11, 2016 at 6:34 pm #103550SaidBitarMemberSorry Oliver for cluttering your thread but just wanted to keep the replies in the same place as the question
So i made some initial tests on two exits and here are my observations
may be due to my limited imagination i can not come with many ideas that are creativeso i made a condition on the exit which will act as a switch between the two exits
Exit number one is if the stock is not making HH and HL any more
Exit number two is if the stock higher closethe switch is ROC(L,2) so if the stock is trending it will make higher lows and we would like to stay in it, the reason i picked up 2 as period is just to avoid the entry bar since the low is lower than the previous day other wise we will not be in the trade and the second reason is to give a small space for the stock to relax and continue moving.
any how it is just what came to my mind i still have to think about a filter or condition that is less awkward.
here how the exit looks like
Code:LExSetUp = IIf(ROC(L,2)>0,L < Ref(L,-1) AND H < Ref(H,-1),C > Ref(C,-1));the surprise is the results are good general summary
Lower win rate and higher W/L ration (expected due to the delayed exits)
higher returns
deeper DDin general it is OK I mean still the system is tradable and and the results are good. may be with other exit conditions the results will be even better
here how the results look like ( these are single runs did not want to make MCs)
So you need to decide if the additional CAR, DD, Returns deserve the extra effort or no.
-
AuthorPosts
- You must be logged in to reply to this topic.