Hi All,
I had an idea for another script (title failure > a script, not an indicator) which I'd like to run on my VMs similar to several others I've already built (with the help of some here). But it appears I'm going to have to use nested IF statements, and multiple ones at that, and I'm running into all kinds of problems figuring out the logic I need.
The concept behind the script is this:
The script will compare the constituent currencies from one primary pair (EURAUD, for example) to two other similar pairs (EURUSD, AUDUSD) to make sure the movement on the primary pair (EURAUD) is accurate.
For example:
If both AUDUSD & USDCAD close positively/bullish on D1(1), AUDCAD should have also closed positively/bullish. If it did not, I want to be made aware of that discrepancy.
I want it to look something like this, ultimately
I can possibly do some of the comparative legwork in the spreadsheet, but I'm having trouble getting even that far. I'm running into problems with the number of variables and the number of IF statements it looks like I need to use. Add to that the possibility of some values being 0 at times and also needing to analyze the inverse of some pairs (highlighted in yellow in the previous image) and it appears I've bitten off way more than I can chew... again.
This is as far as I've gotten so far. I thought I had gotten a good start using numerous successive while() functions but it ended up looping endlessly.
Any help or constructive criticism is appreciated. Thanks for reading.
I had an idea for another script (title failure > a script, not an indicator) which I'd like to run on my VMs similar to several others I've already built (with the help of some here). But it appears I'm going to have to use nested IF statements, and multiple ones at that, and I'm running into all kinds of problems figuring out the logic I need.
The concept behind the script is this:
The script will compare the constituent currencies from one primary pair (EURAUD, for example) to two other similar pairs (EURUSD, AUDUSD) to make sure the movement on the primary pair (EURAUD) is accurate.
For example:
If both AUDUSD & USDCAD close positively/bullish on D1(1), AUDCAD should have also closed positively/bullish. If it did not, I want to be made aware of that discrepancy.
I want it to look something like this, ultimately
I can possibly do some of the comparative legwork in the spreadsheet, but I'm having trouble getting even that far. I'm running into problems with the number of variables and the number of IF statements it looks like I need to use. Add to that the possibility of some values being 0 at times and also needing to analyze the inverse of some pairs (highlighted in yellow in the previous image) and it appears I've bitten off way more than I can chew... again.
This is as far as I've gotten so far. I thought I had gotten a good start using numerous successive while() functions but it ended up looping endlessly.
Inserted Code
int init() {return(0);} int deinit() {return(0);} int start() { int handle; //AUDCAD double AUDCADD1=iClose("AUDCAD",PERIOD_D1,1)-iOpen("AUDCAD",PERIOD_D1,1); double AUDUSDD1=iClose("AUDUSD",PERIOD_D1,1)-iOpen("AUDUSD",PERIOD_D1,1); double CADUSDD1=-1*(iClose("USDCAD",PERIOD_D1,1)-iOpen("USDCAD",PERIOD_D1,1)); string AUDCADlevel; if ( (AUDUSDD1 > 0) && (CADUSDD1 < 0) && (AUDCADD1 > 0) ) AUDCADlevel = "PASS"; else { if ( ) ; else AUDCADlevel = "FAIL"; }
Any help or constructive criticism is appreciated. Thanks for reading.