i I would like to incorporate a trading rule that when price is below a certain price for instance USD JPY 148.37 then it will allow a sell based on other parameters. The EA would run on the time frame and currency.
I have all the coding for the mechanics of the sell etc. I just can't find how to reference the currency properly, I created something like the below:
I am pretty sure this is not the way to do it.
I would then code the criteria elsewhere in the EA:
I might make this just a 'SELL' EA and when price is below 148.37 it should return true. I think my issue is that I am not incorporating the price of JPY (or any other currency) into this bool properly.
Any help appreciated.
I have all the coding for the mechanics of the sell etc. I just can't find how to reference the currency properly, I created something like the below:
Inserted Code
extern string note24 = "UsePriceZone"; extern bool UsePriceZone = true; extern double JPYPrice = 148.37;
I am pretty sure this is not the way to do it.
I would then code the criteria elsewhere in the EA:
Inserted Code
bool IsPriceZoneUp(int i) { if (!UsePriceZone) return(true);
double p1 = iClose(NULL,0,i); return (p1 > JPYPrice );
}
bool IsPriceZoneDown(int i) {
if (!UsePriceZone) return(true); double p1 = iClose(NULL,0,i);
return (p1 < JPYPrice ); } I might make this just a 'SELL' EA and when price is below 148.37 it should return true. I think my issue is that I am not incorporating the price of JPY (or any other currency) into this bool properly.
Any help appreciated.