| stevehopwoodforex.com https://www.stevehopwoodforex.com/phpBB3/ Print view |
|
| Need coding help, please https://www.stevehopwoodforex.com/phpBB3/viewtopic.php?t=4346 |
Page 1 of 2 |
| Author: | LittleCaro [ Fri Jul 10, 2015 1:17 pm ] |
| Post subject: | Need coding help, please |
Hello all, I'm in the making of an ea with a sort of stepma with the incredible steve's shell code. So, i enter when the stepma changes color, but in strong trend, my orders hit the take profits, and immediately a new order open in the same direction, and i don't want that, i only want a new order when stepma changes color. I show you the code, please can someone help me. Thanks ! Code: Select all |
|
| Author: | dietcoke [ Fri Jul 10, 2015 1:55 pm ] |
| Post subject: | Need coding help, please |
This problem will only happen if you take a profit in the same bar you opened it. In this situation, the colour change code will still be valid. When you close the trade have another variable which remains true until the start of the next bar at which point you set it back to false. meantime, in your trading function only enter the trade open code if the variable is false. |
|
| Author: | SteveHopwood [ Fri Jul 10, 2015 6:24 pm ] |
| Post subject: | Need coding help, please |
DC is dead right. Another approach is to include a function that examines all the trades in your History tab and returns a value that says, "Yes, the trade closed on the current candle" or, "No, the trade did not close during the current candle". Include a call to this function within bool IsTradingAllowed(). Suppose you code your function\; bool DidTradeCloseDuringCurrentCandle() The call returns true if so, or false if not. Sing out if you have any problems. I love it when someone is trying to code this stuff for themselves and am happy to help unless I have endured an exceptionally bad day. |
|
| Author: | LittleCaro [ Mon Jul 13, 2015 7:30 am ] |
| Post subject: | Need coding help, please |
Thank you for your enlightment guys. I have updated my shell to the latest shell i find here, and my problem is solved. That's super great, thnaks for this amazing master piece. But now, i have an other problem. I work on 20 minutes chart, and when i backtest on regular time frames my expert is working, but this morning, on my 20 minutes charts, nothing happen. Maybe i should put 20 in the timeframe ? What should i do for the shell working on offline timeframes ? I already tried every ticks without succes. Thanks for all ! |
|
| Author: | oldfella [ Mon Jul 13, 2015 3:17 pm ] |
| Post subject: | Coding help, please |
Hi, I continually use an indicator on my main platform which I have now copied and loaded onto my second computer. Problem is that it doesent work on the second computer, and if compiled shows an 1 error, 1 warning. The 1 error reads "return expressions are not allowed on a global scope" and the warning reads "not all control paths return a value". I can't work out how to correct these problems, or understand how the indicator works fine on one platform and not on the second. Can anyone advise as my programming skills are limited. Oldfella |
|
| Author: | milanese [ Mon Jul 13, 2015 3:21 pm ] |
| Post subject: | Coding help, please |
If you attach your indicator I will take a look into this... Cheers Tommaso |
|
| Author: | LittleCaro [ Mon Jul 13, 2015 4:15 pm ] |
| Post subject: | Need coding help, please |
Hey guys, Always looking for offline charts working with shell. At the end of code i found these : So i add 10 and 20 minutes, but nothing again ! Please help Code: Select all |
|
| Author: | oldfella [ Mon Jul 13, 2015 4:38 pm ] |
| Post subject: | Coding help, please |
Hi, Can you tell how I attach my indicator to this site please. Oldfella |
|
| Author: | milanese [ Mon Jul 13, 2015 4:43 pm ] |
| Post subject: | Coding help, please |
Read there how to attach files ---click----> http://www.stevehopwoodforex.com/phpBB3/kb.php?a=2 |
|
| Author: | oldfella [ Tue Jul 14, 2015 9:25 am ] |
| Post subject: | Need coding help, please |
Hi Milanese, Thanks for the help and info. I first wrote this indicator for my Metastock stock trading program. As you will see it will plot lines, as many as you want, with colour , style etc, all selectable. I must admit I wrote the Empty4 version with advice following Coder Guru's lessons. But age now 80 has overtaken me and the brain doesent work as good as it use too. So I am grateful for any help you can give I have compared the codes on both computers, they are the same, so I cannot see why one works and the other doesent. Allonso is just one of the pseudo names I use. Regards Oldfella |
|
| All times are UTC | Page 1 of 2 |
|
Powered by phpBB® Forum Software © phpBB Limited |
|