S.Mlambo:
HI im a newblie and im am trying to code now i keep getting these 2 arrors
unexpected end of program and unbalanced parentheses.
i have tried using styler but still doesn't work please help me.
see below
You are not showing all your code so difficult to check all the brackets... but this bit is definitely wrong, remove the first bracket after the if if(isLong) } { takeProfit = EntryPrice + Pips * GetPipValue(); }
Go to the unbalanced bracket! It is missing its counterpart.
Thank you very much. i finally got it
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
HI im a newblie and im am trying to code now i keep getting these 2 arrors
unexpected end of program and unbalanced parentheses.
i have tried using styler but still doesn't work please help me.
see below
{ double SignalPrice = 1.28956; int takeProfitPips = 40; int StopLossPips = 30; if(Ask < SignalPrice) //buying { Alert("Price is below SignalPrice, Sending Buy order"); double StopLossPrice = CalculateTakeProfit(true,Ask,StopLossPips); double takeProfitPrice = CalculateTakeProfit(true,Ask,takeProfitPips); Alert("Entry Price = " + Ask); Alert("Stop Loss Price = " + StopLossPrice); Alert("Take Profit Price = " + takeProfitPips); //Send buy order } else if(Bid > SignalPrice) //shorting { Alert("Price is Above SignalPrice, Sending Short order"); double StopLossPrice = CalculateTakeProfit(false,Bid,StopLossPips); double takeProfitPrice = CalculateTakeProfit(false,Bid,takeProfitPips); Alert("Entry Price = " + Bid); Alert("Stop Loss Price = " + StopLossPrice); Alert("Take Profit Price = " + takeProfitPrice); } double CalculatetakeProfit(bool isLong, double EntryPrice,int Pips) { double takeProfit; if(isLong) } { takeProfit = EntryPrice + Pips * GetPipValue(); } else { takeProfit = EntryPrice - Pips * GetPipValue(); } return takeProfit; double CalculateStopLoss(bool islong, EntryPrice, int Pips) { double StopLoss; if(isLong) { Stoploss = EntryPrice - Pips * GetPipValue(); } else { Stoploss = EntryPrice + Pips * GetPipValue(); } return StopLoss; }