Wront Parameter Count for constructor, but I have the same number of parameters
SellOrder sell = new SellOrder(3,3,3);
You are trying to initialize a SellOrder (sell) with a pointer.
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); }; };
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