Ok, i'm sure this must be easier than i'm finding it, but just can't get it to work (very green at programming as well not helping):
I want to use Steve's Shell EA but not fixed stoploss, takeprofit and JumpingStop settings.
If I have 2 values calculated for each new entry from indicators "LONG_STOP_LOSS" and "SHORT_STOP_LOSS", (depending on trade direction) where do i put them to replace the fixed values that come from the "extern" settings but still be able to use % position sizing, jumping stops etc?
LONG_STOP_LOSS and SHORT_STOP_LOSS are prices, not pips, and I want my jumpingstop value to be the same distance as my initial stop.
I'm sure this is very easy, but every time I think I've got it, I end up with some wacky backtest, usually tiny tp when should be much larger.
Steve's Shell EA -SL and TP
- SteveHopwood
- Owner
- Posts: 9904
- Joined: Tue Nov 15, 2011 8:43 am
- Location: Misterton - an insignificant village in England. Very pleasant to live in.
Re: Steve's Shell EA -SL and TP
The shell's are not really for beginner coders; I would imagine they are quite confusing. I publish them because I use them daily and it seems a shame to keep them to myself. Having said that, there is much within them that you can learn from. Although my shell, a lot of the code has been provided by some seriously clever programmers - their is an appreciation inside all the relevant functions.monkeyzu wrote:Ok, i'm sure this must be easier than i'm finding it, but just can't get it to work (very green at programming as well not helping):
I want to use Steve's Shell EA but not fixed stoploss, takeprofit and JumpingStop settings.
If I have 2 values calculated for each new entry from indicators "LONG_STOP_LOSS" and "SHORT_STOP_LOSS", (depending on trade direction) where do i put them to replace the fixed values that come from the "extern" settings but still be able to use % position sizing, jumping stops etc?
LONG_STOP_LOSS and SHORT_STOP_LOSS are prices, not pips, and I want my jumpingstop value to be the same distance as my initial stop.
I'm sure this is very easy, but every time I think I've got it, I end up with some wacky backtest, usually tiny tp when should be much larger.
extern inputs such as TakeProfitPips are int to avoid confusing newbs with the decimal point, but they need to be converted into doubles to work with factor (calculated in PFactor() ). So, TakeProfitPips is read into the double TakeProfit in int init(). So, to remove any possibility of TakeProfit buggering up your calculations, delete it from the source code and recompile. Then follow all the error messages that result and delete the offending code snippet.
Read the effing manual, ok?
Afterprime is the official SHF broker. Read about them at https://www.stevehopwoodforex.com/phpBB3/viewtopic.php?p=175790#p175790.
I still suffer from OCCD. Good thing, really.
Anyone here feeling generous? My paypal account is always in the market for a tiny donation. pianodoodler@hotmail.com is the account.
To see The Weekly Roundup of stuff you guys might have missed Click here
My special thanks to Thomas (tomele) for all the incredible work he does here.
Afterprime is the official SHF broker. Read about them at https://www.stevehopwoodforex.com/phpBB3/viewtopic.php?p=175790#p175790.
I still suffer from OCCD. Good thing, really.
Anyone here feeling generous? My paypal account is always in the market for a tiny donation. pianodoodler@hotmail.com is the account.
To see The Weekly Roundup of stuff you guys might have missed Click here
My special thanks to Thomas (tomele) for all the incredible work he does here.
- fxdaytrader
- Trader
- Posts: 190
- Joined: Sun Jun 10, 2012 7:03 am
- Location: Poon-Town (germany, se-asia, se-europe) ...
Re: Steve's Shell EA -SL and TP
Hi monkeyzu,

Add on the relevant positions e.g.:
StopLoss = CalcDistance(price,YOURVALUE);
where price = Ask/Bid depending on the ordertype and YOURVALUE the price you want to calculate the distance from.
This would override the stoploss-settings.
Further you have to add a new function to the shell:
I am also not a "coding pro", but I keep on learning 
You may find examples in my post about my attempt to advance steve's shell ea code to build eas much easier (find it here). You will find the newest updates on the bottom.
There you may find how you could solve that problem, I implemented i.a. much new functions for trailingstop and stoploss-calculation, and until now, they seem to work.
It is not perfect (yet?), but a beginning.
The longest journey starts with the first stepmonkeyzu wrote:Ok, i'm sure this must be easier than i'm finding it, but just can't get it to work (very green at programming as well not helping)
you could change the pips allocated to the stoploss-variable in the function double CalculateStopLoss(int type). There you have to watch out for the OP_BUY/OP_SELL conditions.monkeyzu wrote: I want to use Steve's Shell EA but not fixed stoploss, takeprofit and JumpingStop settings.
If I have 2 values calculated for each new entry from indicators "LONG_STOP_LOSS" and "SHORT_STOP_LOSS", (depending on trade direction) where do i put them to replace the fixed values that come from the "extern" settings but still be able to use % position sizing, jumping stops etc?
LONG_STOP_LOSS and SHORT_STOP_LOSS are prices, not pips, and I want my jumpingstop value to be the same distance as my initial stop.
Add on the relevant positions e.g.:
StopLoss = CalcDistance(price,YOURVALUE);
where price = Ask/Bid depending on the ordertype and YOURVALUE the price you want to calculate the distance from.
This would override the stoploss-settings.
Further you have to add a new function to the shell:
Code: Select all
int CalcDistance(double price1,double price2) {
int pips = NormalizeDouble((MathAbs(price1 - price2) * factor),0);
return(pips);
}
You may find examples in my post about my attempt to advance steve's shell ea code to build eas much easier (find it here). You will find the newest updates on the bottom.
There you may find how you could solve that problem, I implemented i.a. much new functions for trailingstop and stoploss-calculation, and until now, they seem to work.
It is not perfect (yet?), but a beginning.