Hi hope you can help
Hi all i am trying something out on the bob scalper method. I am trying to put together and ea I have 2 current problems
1) I want to stop the ea for a pair if the stoploss is hit
I am setting the stoploss to the Daily Pivot (variable - DP), I have the DP value set in Global Varibles and am pulling this value into the ea fine (I display it on the chart via screen message) but using this code does not seem to work to set the stop loss when a trade is triggered
'double stop = NormalizeDouble(DP ,Digits);
bool result = SendSingleTrade(OP_BUY, TradeComment, Lot, Ask, stop, take);
Trade is being sent but with sl 00000'
2) I have again a variable vsacode which i pulldown from globalvariables the number is either a number between 0-8 , 9-22 or a no signal value 2147483647
I am trying to us a simple if statement to provide signal (signal1) for the ea
code is
double vsacode=GlobalVariableGet(Symbol()+ "vsacode");
int signal1;
if (vsacode < 9){signal1 = 1;}
if (vsacode >8){signal1 =2;}
if (vsacode >30){signal1=vsacode;}
Again for confirmation i am displaying the value in the chart value vsacode and signal 1
What i get is vsacode values correct ie either a number from 0-8 , 9-22 or 2147483647
but the signal 1 value is either 0 or 2147483647
Help please
Hi all i am trying something out on the bob scalper method. I am trying to put together and ea I have 2 current problems
1) I want to stop the ea for a pair if the stoploss is hit
I am setting the stoploss to the Daily Pivot (variable - DP), I have the DP value set in Global Varibles and am pulling this value into the ea fine (I display it on the chart via screen message) but using this code does not seem to work to set the stop loss when a trade is triggered
'double stop = NormalizeDouble(DP ,Digits);
bool result = SendSingleTrade(OP_BUY, TradeComment, Lot, Ask, stop, take);
Trade is being sent but with sl 00000'
2) I have again a variable vsacode which i pulldown from globalvariables the number is either a number between 0-8 , 9-22 or a no signal value 2147483647
I am trying to us a simple if statement to provide signal (signal1) for the ea
code is
double vsacode=GlobalVariableGet(Symbol()+ "vsacode");
int signal1;
if (vsacode < 9){signal1 = 1;}
if (vsacode >8){signal1 =2;}
if (vsacode >30){signal1=vsacode;}
Again for confirmation i am displaying the value in the chart value vsacode and signal 1
What i get is vsacode values correct ie either a number from 0-8 , 9-22 or 2147483647
but the signal 1 value is either 0 or 2147483647
Help please