| stevehopwoodforex.com https://www.stevehopwoodforex.com/phpBB3/ Print view |
|
| Need some help please https://www.stevehopwoodforex.com/phpBB3/viewtopic.php?t=4553 |
Page 1 of 1 |
| Author: | xfactornos [ Mon Dec 28, 2015 4:51 pm ] |
| Post subject: | Need some help please |
Hey guys, I am trying to automate my indicator and its kicking my ass!!!! Its so frustrating because it seems so simple but I cant get it to work. First off, About the indicator, Its something I coded, and it draws the arrows correctly. All it does is draw an arrow when i tell it to. so, When there is a buy situation, a buy arrow goes in Buffer 0, when there is a sell situation a sell arrow goes in buffer 1. When there is no signal the buffers read 0.0000. easy enough right? thats what i thought too but I cant get it to work right. ALL i want it to do is, IF value is non empty in the buffer, to place the trade. Logic.... if there is a value there, that means there is an arrow. Once again easy.... so, I looked at Steve's HGI bot because its the same idea. If there is something in the buffer place the trade. I have tried so many different methods that I'm just beyond pissed and hence why I'm asking for help. THE PROBLEM: It seems to place buy and or sell trades whenever the hell it feels like it. I even create an alert for debugging to spit out the values being read, and they state 0 when a trade is placed. I shift over 1, because the arrow paints a candle behind, never on the current candle... The code, keep in mind i modeled the HGI code. Code: Select all Code: Select all Code: Select all I just want to buy when there is an arrow(value) in buffer 0, and sell when there is an arrow(value) in buffer 1. Thanks for any input guys. |
|
| Author: | renexxxx [ Mon Dec 28, 2015 8:20 pm ] |
| Post subject: | Need some help please |
These code snippets are not long enough to find the bug. I don't see for instance where and if you set GoodToRise and GoodToFall to false. If you never (re)initialize these flags they will always stay true, once they have been set to true. You may also want to consider to make these flags local variables if they don't have to be global. But attach the complete script if you want some more help. René |
|
| Author: | xfactornos [ Mon Dec 28, 2015 8:48 pm ] |
| Post subject: | Need some help please |
Sorry René, See attached |
|
| Author: | SteveHopwood [ Tue Dec 29, 2015 12:57 am ] |
| Post subject: | Need some help please |
Good to see you trying this for yourself. You really need to take on board Rene's previous post. If you never reset a variable to false, then once true it will be true until you next reset your platform. I have not looked at your code but would happily bet a fiver that you have made just this sort of mistake. Guess how I know? Hint: if a variable needs to be set to 'true' once something or other is calculated, then set it to 'false' before entering the calculation. |
|
| Author: | renexxxx [ Tue Dec 29, 2015 4:21 am ] |
| Post subject: | Need some help please |
I don't have access to a PC at the moment as I am travelling in the Netherlands and could only look at your code on a phone, but what struck me immediately is that GoodToRise and GoodToFall are declared as doubles and later on treated as booleans. This won't work, and must be corrected first. I can not say whether the rest of the code is correct, but good luck with it. |
|
| Author: | xfactornos [ Tue Dec 29, 2015 12:09 pm ] |
| Post subject: | Need some help please |
Thanks guys :hi: |
|
| All times are UTC | Page 1 of 1 |
|
Powered by phpBB® Forum Software © phpBB Limited |
|