You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
And lets say I declare val1 with shift 3
and then the loop of course is shift i
If I refer to val1 outside the loop, will I be talking about val1 global or val1 looped ?
I guess I'm wondering if I should add a separate global fractal for my if statements like val3 and val4 or something
I'm sort of getting stuck here, but seems like the ABCD scheme is at least making a little progress
Anyhow here is the code any ideas ?
So the A would be the previous low and the val1 should be the current shift 3, and same with a and val2
I have to retest some more to be sure that A and a are referring to the correct values because I added the !=0 statements so that it would not print the empty values.
Seems to be ok at first look, but I need to re-confirm this
Anyhow to restate this:
Does the val1 in my if(statement) properly refer to the correct condition or do I need a completely different iFractal to refer to shift 3
I can't really tell if it's working right or not, it appears to be working but something doesn't seem right and I can't quit put my finger on it.
Please advise
Thanks
Although this is really not an indicator topic anymore, should I move this to a new topic ?
If I use something like this
And lets say I declare val1 with shift 3
and then the loop of course is shift i
If I refer val1 outside the loop will I be talking about val1 global or val1 looped ?
I guess I'm wondering if I should add a separate global fractal for my if statements like val3 and val4 or something
val1 & val2 are declared with global scope, i is declared locally within start().
val1 and val2 inside or outside the loop have the last value that was assigned to them . . . that happens before the loop and then the values may be changed inside the loop . . . once the loop is exited the values are what they are and remain that way until start() is called the next time, then they are reset and then possibly modified in the loop . . . etc. etc.
val1 & val2 are declared with global scope, i is declared locally within start().
val1 and val2 inside or outside the loop have the last value that was assigned to them . . . that happens before the loop and then the values may be changed inside the loop . . . once the loop is exited the values are what they are and remain that way until start() is called the next time, then they are reset and then possibly modified in the loop . . . etc. etc.
I could try to go after the values while in the loop and just redeclare val1 and val2 =iFractal,,,3 again. To reset things but only after I declare A=val2 and a=val1 so I have a value for these which hopefully is my previous fractal if I have this right.
Or I could redeclare val 1 and val2 outside the loop, but I don't want to loose the value for A or a so I just have to work it out at the proper times I think.
I also could be going about this all together wrong but no matter. Gotta start somewhere, so I picked this for now;and i can adjust it as I get more experience.
Thanks for the helpI'm guessing I should probably changed these to val3 and val4 in order to use the actual iFractal for trading and only reference and use (A) and (a) for to reference my previous fractal.
I'll keep working on it
Thanks
After a few days thinking about it and trying to work through the logic I think I have a better working code now although not perfect but it's progressing
So I have my A and B values and while an indicator statement is placed in the initial if(statements && indicators) the values print once for example MACD faster > slower or some such indicator statements.
So I get only A and B as I would like
I'm not sure why it prints multiple times when the indicator options are taken away from my if(statements)
Anyhow I'm getting a little closer with this ABCD type of scheme which can be used on other indicators too not just fractals etc. for future reference
Please advise
Thanks
This might help you out. It's a indicator to access the last fractals and the shift so you could use to work out your ABCD.
That will give upper fractals. Change "" to "L" for lower fractals.
Will give the fractal before the most recent one.
This might help you out. It's a indicator to access the last fractals and the shift so you could use to work out your ABCD.
That will give upper fractals. Change "" to "L" for lower fractals.
Will give the fractal before the most recent one.
prior to my latest code in this thread I had worked out some various (for) statements with some help and it was also an indicator I was able to draw what I wanted in the buffer, however this brought me to another problem of trying to extract the values and only printing those values once to be used or referenced.
Since these various for statements cause problems for me and those are similar to the code you posted.I was never able to get the values without constantly printing the value each and everytime it becomes true which is continuously.
I've worked out some of this but still never really learned how to stop once a condition is true.
I see in your code one thing that might help is the static datetime block and I've used that only once before to refer to the condition only when a new bar and new bar time comes in.
This part might be helpful with what I'm working. And although my current code does produce the current fractal and the previous fractal currently it's working
The only problem I mostly have is that once the condition is true it prints out the statement continuously which could be ok, but this means it will also probably place a trade continuously once I get to that point.
Perhaps I need more experience on how to use iCustom indicators and this might solve a lot of my troubles, but I am not that far in my learning yet.
I'll review this code some more, and the EMPTY_VALUE parts. Now that I see that in use I can learn from that as well. It was suggested before but I never understood how to use it.
I'll keep working on it
Thanks for the help
Then it works and only gives exactly what I want which is print the A low, B high, then and/or B low and A high
But if I take out the faster > slower and faster < slower on both these if statements then I notice it NEVER prints the A high and also continuously prints the others which I'm confused about
I'll keep working on, i'm sure that I need to get it to print the statement once with no other indicators statements in the EA so I know that indicators won't interfere with the ABCD parts of the code
Back to the drawing board
I think your trouble is in you haven't reset val1 and val2. So once you've found the high and last low you need to reset them:
Hopefully that will help.