what's wrong in this code?
refers to the first if
thanks
No syntax error in that code, you probably forgot to add a semicolon or close a brace in other part of the code.
The problem is with the code above your if.
void OnTick(){ createBuffers(); //open position if(!isInTheMarket){ if(isADXSetupForBuy() && isADXForBuy){ buy(); }else if(isADXSetupForSell() && isADXForSell){ sell(); } } //change trailing stop if(isInTheMarket && isTimeToChangeTrailingStop()) changeTrailingStop(); //break heaven if(isTimeToGoToBreakHeaven()) goToBreakHeaven(); // fix the variables if( isPositionOpen() ){ isInTheMarket = true; if( positionInfo.PositionType() == POSITION_TYPE_BUY ) isInBuy = true; else if( positionInfo.PositionType() == POSITION_TYPE_SELL ) isInSell = true; }else{ isInTheMarket = false; isInBuy = false; isInSell = false; isBreakHeaven = false; } if(adxDIPBuffer[0] > adxDIMBuffer[0]){ isADXForBuy = true; isADXForSell = false; }else if(adxDIPBuffer[0] < adxDIMBuffer[0]){ isADXForBuy = false; isADXForSell = true; }else{ isADXForBuy = false; isADXForSell = false; } //set adxStatus and isADXReady when dip and dim cross themself if( ( (adxStatus == bull) || (adxStatus == neutral) ) && (isADXForSell == true) ){ adxStatus = bear; isADXReady = true; }else if( ( (adxStatus == bear) || (adxStatus == neutral) ) && (isADXForBuy == true) ){ adxStatus = bull; isADXReady = true; } }
The error is not in this block of code, it's somewhere else. My guess is that you forgot to add a semicolon to the end of a class or structure as
it can generate cryptic errors like this.
I also recommend that you use a source control system like Git, this way, in the future, if you get a similar problem you'll be able to pinpoint
all the parts of the project you changed that might have caused the issue.
The error is not in this block of code, it's somewhere else. My guess is that you forgot to add a semicolon to the end of a class or structure as
it can generate cryptic errors like this.
I also recommend that you use a source control system like Git, this way, in the future, if you get a similar problem you'll be able to pinpoint
all the parts of the project you changed that might have caused the issue.
I really don't know, I repeat ... if I comment on that little piece of code where the error is reported to me, everything is compiled normally.
I also tried to create a function where to put that code, same errors.
this is the github repository:
https://github.com/CaneRandagio1983/adx-ea
thanks guys
adxStatus is a type. The expression should take a variable of that type.
enum ADXStatus{neutral,bull,bear}adxStatus;
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
what's wrong in this code?
refers to the first if
thanks