| stevehopwoodforex.com https://www.stevehopwoodforex.com/phpBB3/ Print view |
|
| Scaling Out Script https://www.stevehopwoodforex.com/phpBB3/viewtopic.php?t=3704 |
Page 1 of 2 |
| Author: | DocT [ Thu Jun 26, 2014 3:49 pm ] |
| Post subject: | Scaling Out Script |
Tommasso/Steve/Coders I wonder if you can help? I am looking for a script (or two - one long one short) to help semi-automate manual trading for use on H4 and D charts - this would be a Scale Out Script as opposed to Scale In. In these ranging times, and following NBs 10.7 and 10.9 where the max price moves 1 to 3 levels before retracing, I would like to be able to send one pending order and then scale out x% at +y pips etc. Example below: 1. Place initial pending trade, with SL and TP (pip based or line based or ATR based) 2. Scale out trade as price moves in direction of trade a) after x pip move, close 50% of initial trade and move SL to +y pips (BE +1 or 50% initial SL) [50% left] b) after x pip move, close 50 % of trade remaining [25% left], move SL to +z pips or to BE+1 c) after x pip move, close 50% of remaining trade [12.5% left], trail stop or jump stop d) trail SL with price - final 12.5% close out on jumping stop or TP I do this using multiples of 10.6 Drop_Pending-Buy/Sell scripts but end up with so many lines on the charts and it can become complicated moving the SLs etc. I have searched the forum, and internet, but most are Scale In scripts. I even tried a commercial Money Management EA which had a scale out feature but a) it was an EA and b) it used so much real estate on the screen that I couldn't see the Price Action. Also I appreciate that when the markets start to trend again, using Scale In Scripts would be preferable - and those are already coded here on SHF (and I do use these too). But in ranging markets or slow moving markets a Scale Out script would be really useful. Thanks for your consideration in this. Cheers Doc |
|
| Author: | milanese [ Thu Jun 26, 2014 5:10 pm ] |
| Post subject: | Scaling Out Script |
Hi Doc, I see it nearly impossible to do, what you want, with a script, imo this kind of scaling out needs an EA. Cheers Tommaso |
|
| Author: | DocT [ Thu Jun 26, 2014 5:34 pm ] |
| Post subject: | Scaling Out Script |
Tommaso Oh dear, I did wonder. So I was looking for the impossible - good to know. In that case, how easy to create an EA for Scale Out? And is it possible to behave like. Script and delete itself after SL or TP??? Thanks Doc |
|
| Author: | milanese [ Thu Jun 26, 2014 5:41 pm ] |
| Post subject: | Scaling Out Script |
it is easy to code that it would remove itself from the chart if the work is done. For the rest you should explain exactly how you want to have the EA to work.. Cheers Tommaso |
|
| Author: | DocT [ Fri Jun 27, 2014 12:09 pm ] |
| Post subject: | Scaling Out Script |
Tommaso OK - here goes... This is the way I imagine this EA to function – hopefully it will be possible: 1. Place pending trade on chart with initial SL and TP, and 3 Scale Out Levels pre-defined [basic would be by defined number of pips; but could be x.00 or x.50 horizontal levels; % ATR; fibs or pivots]. It would be good if all the trade lines - SL, TP, SOs - can be moved by dragging on the chart. 2. As price moves in our direction, trade activated a. IF price does not activate trade within x time, deactivate EA 3. As price reaches pre-defined Scale Out Level 1, close 50% (variable) and move SL to BE + 2pips (variable) 4. As price reaches SO level 2, close 50% (variable) and move SL to SO Level 1 5. As price reaches SO level 3, close 50% (variable) and move SL to SO Level 2 6. Remaining % to close at either: a. initial TP b. Trail SL c. Jump SL d. Candle SL e. More sophisticated option to capture as much of the remaining move as possible in combo with trail SL or jump SL, would be to also move the TP forward by x pips as price gets within y pips [a jump TP - I do not know if this is possible but would be amazing if you can code it] 7. On closure, EA should deactivate and remove itself from chart. I have annotated a chart to hopefully illustrate what I mean. The EA will need all the usual functions of the Shell eg trading time frame management, lot size or risk percent, TP and SL, Magic number and trade comment, ECN etc. However, as this is a tool for manual trading, it does not need the more sophisticated aspects of the Shell – MA, Slope, CSS etc. It does need Trading Hours and some people may want Alerts – I don’t. For me, the idea is to leave the trade to either TP or SL – a semi-automatic manual system. Thanks Tomasso – if you need any more information, please let me know. Doc |
|
| Author: | milanese [ Fri Jun 27, 2014 12:28 pm ] |
| Post subject: | Scaling Out Script |
Cheers Tommaso |
|
| Author: | DocT [ Fri Jun 27, 2014 12:57 pm ] |
| Post subject: | Scaling Out Script |
Much appreciated Tommaso. I think this would be a really useful EA for many people, especially those who trade NB10.7 and 10.9 with TMA. I know you are busy so fingers crossed you can find some time Thanks Doc |
|
| Author: | milanese [ Fri Jun 27, 2014 5:23 pm ] |
| Post subject: | Scaling Out EA |
Hic Doc, here comes the first version of Scale Out EA, the relevant inputs are: DelteOrderAfterXMinutes if the pending order is not filles in x minutes, the EA will be remove itself from the chart, set this to 0 and the EA will never be removed from chartBuyEntry Here you set your PendingPrice Buy it must be > as the actual ASK, setting here 0 will deactivate the BUY functionc]SellEntry[/c] Here you set your PendingPrice Sell it must be < as the actual Bid, setting here 0 will deactivate the SELL function MaxSpreadAllowedMultiplicator here you can set how much the actual spread could be higher than the average spread for opening the orderScaleOutLevelOnePipshere you enter the pips needed for the first part close and the BE settingScaleOutLevelTwoPipshere you enter the pips needed for the second part close and moving SL to the ScaleOutLevelOneScaleOutLevelThreePips here you enter the pips needed for the third part close and moving SL to the ScaleOutLevelTwoBEProfit this is added to the OpenPrice if BE is setPartClosePercent enter here the PartClosePercent you wish every step closedThe rest should be self explaining, the EA will be remove itself from chart if all open positions are closed and DelteOrderAfterXMinutes is not set to 0.
Cheers Tommaso |
|
| Author: | DocT [ Fri Jun 27, 2014 9:23 pm ] |
| Post subject: | Scaling Out EA |
Brill Tommasso - that was quick I look forward to seeing it in action on Monday. I will keep you posted on how it functions. Thanks and have a great weekend. Cheers Doc |
|
| Author: | DocT [ Tue Jul 01, 2014 8:14 am ] |
| Post subject: | Scaling Out Script |
Tommaso The markets are quite quiet so not much to report on ScaleOutAndMore EA. I have several trades entered but none reached Scale In levels - yet The only request at this time would be to be able to see the pending trades and scale in levels on the actual chart - at the moment all is hidden. However, I will report back on the scale in's/part closure as and when. Thanks Tommaso Doc |
|
| All times are UTC | Page 1 of 2 |
|
Powered by phpBB® Forum Software © phpBB Limited |
|