Forum

Open a position error?

Hi all, I'm writing a simple code to open a position BUY and SELL...just to learn, but it doesn't work. Anyone can tell me why? I have declared all variables (SL, TP and lots) and the code has been compiled succesfully...but it doesn't open positions... Thanks in advance int OnInit () { //---

if condition doesn't work properly

Hi, I'm trying to do an if condition but it doesn't work. It always results in condition as candle1=1 even if for each timer I change this variable. Where I'm going wrong? Thanks in advance Regards int candle1=0; int OnInit() { EventSetTimer(Timer); //--- return(INIT_SUCCEEDED); } void OnTimer() {

if condition with && doesn't work

I have a problem with if condition and && operator. This simple code alway give "true" as result, when must give "false". Any idea about the problem? I'm getting crazy.... Thanks in advace double a= 3 ; double b= 5 ; bool c= true ; bool d= false ; if ((a<b)&&(c= true )&&(d= true )) {

if condition with && doesn't work

I have a problem with if condition and && operator. This simple code alway give "true" as result, when must give "false". Any idea about the problem? I'm getting crazy.... Thanks in advace double a= 3 ; double b= 5 ; bool c= true ; bool d= false ; if ((a<b)&&(c= true )&&(d= true )) {