Welcome to Forex-TSD!, one of the largest Forex forums worldwide, where you will be able to find the most complete and reliable Forex information imaginable.
From the list below, select the forum that you want to visit and register to post, as many times you want. It’s absolutely free. Click here for registering on Forex-TSD.
Exclusive Forum
The Exclusive Forum is the only paid section. Once you subscribe, you will get free access to real cutting-edge Trading Systems (automated and not), Indicators, Signals, Articles, etc., that will help and guide you, in ways that you could only imagine, with your Forex trading.
Elite Section
Get access to private discussions, specialized support, indicators and trading systems reported every week.
Advanced Elite Section
For professional traders, trading system developers and any other member who may need to use and/or convert, the most cutting-edge exclusive indicators and trading systems for MT4 and MT5.
I was hoping for some guidance on coding that I can't seem to figure out. Simply put, I see the problem of being able to do addition but not being able translate that into multiplication.
Here's the problem:
I need to look for a specific pattern on the Force indicator over 3 different periods in one timeframe. Now the problem is that this pattern can occur anytime in the past 30 bars for anyone period.
I have done simple crosses before by looking at the previous 2 bars to make a decision, but not anything where the condition can be met anytime within the past x bars. I think I've seen an indicator that did something like this and might have used an array function, but don't remember exactly.
So the indicator must remember that it has recognized the pattern and watch out for the same pattern in the subsequent periods. So the counter would start once the first pattern is recognized and then would reset after 30 bars have passed and the other periods don't create the necessary pattern.
I've attached a screen shot showing an example which has the Force Indicator withthe periods, 2, 13, and 26. I'm looking for upside down "v" formations over specific levels for a short trade. In this case the critical "v" formation on the 2 period is 350, 200 on the 13 period and between 50 and 100 on the 26 period.
Thanks for anyone's help out there!
Mike
__________________
--------------------------------------------------
"Treat people as if they were what they ought to be and help them become what they are capable of being." Goethe
__________________
--------------------------------------------------
"Treat people as if they were what they ought to be and help them become what they are capable of being." Goethe
Well I was able to get a response from someone in the mql4 forum but the indicator doesn't paint arrows on the chart - and they haven't been available to provide anymore help.
Can someone take a look at the - I think this type of event tracking indicator can be very useful for others and that it could be adapted to your favorite.
Newdigital - not sure if this thread should stay here or be moved to the 'indicator' posts.
__________________
--------------------------------------------------
"Treat people as if they were what they ought to be and help them become what they are capable of being." Goethe
No problem, but the code still needs work to make it viable...
__________________
--------------------------------------------------
"Treat people as if they were what they ought to be and help them become what they are capable of being." Goethe
I have done simple crosses before by looking at the previous 2 bars to make a decision, but not anything where the condition can be met anytime within the past x bars. I think I've seen an indicator that did something like this and might have used an array function, but don't remember exactly.
It's not really that hard, just use the same code that you use for the 2 bar verification and just loop back 30 days and verify the condition for every of those X days.
this sounds quite an interesting indicator so I might take a look at coding it later, the most important things are the exact values on how high the peak should be on each indicator.
With this condition PForce two bars ago should be < 350 and PForce one bars ago should be > 350 and PForce current bars should be < 350.
And this is just to start because you´re requesting 9 consecutive conditions to assign a value.
Yes - you are correct - I was specifically looking at this combo of critical lines for the GBPJPY on the hour charts.
I found that when looking back at the charts, the most significant moves came they was a tight "v" pattern across a critical line. This I found helped me to stay out of sideway markets.
__________________
--------------------------------------------------
"Treat people as if they were what they ought to be and help them become what they are capable of being." Goethe
It's not really that hard, just use the same code that you use for the 2 bar verification and just loop back 30 days and verify the condition for every of those X days.
this sounds quite an interesting indicator so I might take a look at coding it later, the most important things are the exact values on how high the peak should be on each indicator.
Hi mikkom,
You're right, I could create 30 pair of 'or' statements per indicator period, but I was hoping the coding could be done cleaner so that I could begin running tests looking for optimized levels and the amount of time to review.
That's why I alluded to this being a problem similar to expressing it in additional form vs. multiplication.
__________________
--------------------------------------------------
"Treat people as if they were what they ought to be and help them become what they are capable of being." Goethe
Hi mikkom,
You're right, I could create 30 pair of 'or' statements per indicator period, but I was hoping the coding could be done cleaner so that I could begin running tests looking for optimized levels and the amount of time to review.
That's why I alluded to this being a problem similar to expressing it in additional form vs. multiplication.
I didn't mean 30 ors at all, more like (pseudocode follows..)
Code:
/** 1st indicator / timeframe **/
found = false;
for(int i=0; i<30; i++) {
// Check for current time +i
if(pattern found) {
found=true;
break;
}
}
/** 2nd indicator **/
found2 = false;
for(int i=0; i<30; i++) {
// Check for current time +i
if(pattern found at current time +i) {
found2=true;
break;
}
}
/** 3rd indicator **/
found3 = false;
for(int i=0; i<30; i++) {
// Check for current time +i
if(pattern found) {
found3=true;
break;
}
}
bool allPatternsFound = found && found2 && found3;
Something like that.. (by using arrays as cache it will be faster but the idea is the same)
(ps. just running annoyingly long optimization to find some more good probabilities for my little EA, 4 more hours to go... booring)