Drew Clayman:t I'm getting an error saying the parameter count is wrong,
SellOrder sell = new SellOrder(3,3,3);
You are trying to initialize a SellOrder (sell) with a pointer.
Drew Clayman:
I'm trying to just make a basic Object, but I'm getting an error saying the parameter count is wrong, but it seems the number of parameters in the object creation are the same as in the constructor, so I don't know why I'm getting this error
Use either :
SellOrder sell(3,3,3); // an object
or
SellOrder *sell = new SellOrder(3,3,3); // a pointerBut not a mix of both.
If I add SellOrder() as a default constructor, it works fine. But what is really going on here?
What is the answer for the question?
Why does it get "Wrong Parameter Count" here?
class SellOrder{ public: int magicNumber; double lots; double stopLoss; double takeProfit; SellOrder(){} SellOrder(int theStopLoss, int theTakeProfit, int theMagicNumber){ lots = .1; stopLoss = Bid + Point*10; takeProfit = Bid - Point*theTakeProfit*10; magicNumber = theMagicNumber; } void execute(){ OrderSend(NULL,OP_SELL,lots,Ask,Bid,stopLoss,takeProfit,NULL,0,0,clrNONE); }; };
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
I'm trying to just make a basic Object, but I'm getting an error saying the parameter count is wrong, but it seems the number of parameters in the object creation are the same as in the constructor, so I don't know why I'm getting this error