Hi i am trying to get this code to work -
The rules are:-
1) Test for open of new bar
2) if open of the new bar is above coral line and there has been a cross from below the line to above the line open buy (BUYme=1) reverse true for sell ie
If open bar is below coral line and there has been across of the line from above to below then sell (SELLme = 1)
Here is the code the test for new bar calls function and works fine
int isignal = 0;
int psignal;
if (NewBar() == true)
{
double coral = iCustom(NULL, 0, "coral",3,CandleToUse);
if(Open[0] > coral ) {isignal=1;} if (Open[0]< coral) {isignal =2;}
if(isignal==1 && isignal != psignal) {BUYme=1;} if(isignal==2 && isignal != psignal){SELLme=1;}
}
psignal=isignal;
Hope someone can help
The rules are:-
1) Test for open of new bar
2) if open of the new bar is above coral line and there has been a cross from below the line to above the line open buy (BUYme=1) reverse true for sell ie
If open bar is below coral line and there has been across of the line from above to below then sell (SELLme = 1)
Here is the code the test for new bar calls function and works fine
int isignal = 0;
int psignal;
if (NewBar() == true)
{
double coral = iCustom(NULL, 0, "coral",3,CandleToUse);
if(Open[0] > coral ) {isignal=1;} if (Open[0]< coral) {isignal =2;}
if(isignal==1 && isignal != psignal) {BUYme=1;} if(isignal==2 && isignal != psignal){SELLme=1;}
}
psignal=isignal;
Hope someone can help