| stevehopwoodforex.com https://www.stevehopwoodforex.com/phpBB3/ Print view |
|
| Using iMAOnArray() function correctly. https://www.stevehopwoodforex.com/phpBB3/viewtopic.php?t=3472 |
Page 1 of 1 |
| Author: | Arav [ Sat Mar 01, 2014 1:17 pm ] |
| Post subject: | Using iMAOnArray() function correctly. |
Hello All, Hope you are doing fine. I am having problem with defining 'iMAOnArray()' function. I am planning a strategy with 'Stochastic Crossover' with Moving Average in the 'Precious Indicator's Data'. [See the attached Image, Yellow one is the MA] The idea is when the MA will cross the 'Signal Line' of Stochastic, it'll produce Buy/Sell accordingly. I have tried to get idea about 'iMAOnArray' and arranged things like this: Code: Select all But matter of great regret is that I am not getting any value other than '0' for Signal Line and MA. Signal Sto's Value=0.000000000 MA_Signal_Sto's Value=0.00000 So I am doing it wrong. So please correct me or refer me to the example where such MA crossover with Stochastic is discussed elaborately. Thanks |
|
| Author: | milanese [ Sat Mar 01, 2014 6:44 pm ] |
| Post subject: | Using iMAOnArray() finction correctly. |
Your code can't work.. you should try something like Code: Select all Tommaso |
|
| Author: | Arav [ Sat Mar 01, 2014 8:01 pm ] |
| Post subject: | Using iMAOnArray() finction correctly. |
Hello Thanks a lot that you took time for giving solution. I'll try it for sure. Just another request, is it possible to show why my code wouldn't work? I am learning now. So it is necessary for me to know why it failed. Otherwise if I just copy a template then things will work but my skills wont develop. Thanks once again. Regards |
|
| Author: | milanese [ Sat Mar 01, 2014 8:20 pm ] |
| Post subject: | Using iMAOnArray() finction correctly. |
Hi, using Signal_Stochastic<MA_Signal_Sto will not work as Signal_Stochastic is an array, this is an invalid array access, so you must use Signal_Stochastic[0] or what ever bar you want to have checked.And you need to set a size for your array, so ArrayResize(Signal_Stochastic, Bars); is needed ..Cheers Tommaso |
|
| Author: | Arav [ Sun Mar 02, 2014 7:21 am ] |
| Post subject: | Using iMAOnArray() finction correctly. |
Thanks a lot for the reply. You know what I have seen many 'Programmers' who just don't tell the exact point rather extends the conversation by giving Hints to the solution indirectly. But they don't understand that 'Programming' is not 'Mathematics' like you know the 'Laws', you know the ways of 'Calculations', now you have to figure out the solutions by brain storming. Programming is the summation of a bunch of 'Pre-Defined' compatible languages which need to be followed strictly. If anything needs to be defined, it needs to Exactly like what is 'Pre-Defined'. You can't be innovative in doing that in a different way like 'Mathematics'. [Though one can implement a Logic in different ways like using for/while/if] So as a Newbie it is really tough to figure out the mistake(s). Especially when you are trying to learn by yourself with the help of some basic books and other experienced coders. They can just tell where the Problem is or what was wrong and give the solution or Hint directly thus Newbie can understand "okay, the way of defining this is like that and I have done this wrong". But I hardly found anyone does like this. I have even got a one page 'Lecture' on how to improve myself as a 'Coder' but didn't get anything about my 'Mistake' and it's reason which could be told withing 'Few' lines! That's why I am Grateful to you that at least you weren't like 'Others'. |
|
| All times are UTC | Page 1 of 1 |
|
Powered by phpBB® Forum Software © phpBB Limited |
|