We store data obtained using MT4 in our own class.
I would like to set it to the list using the code below and sort it by the positionProfitLoss column in the list. Could you tell me how to compare, sort?
class HogeClass:public CObject{
public:
string hogeId, hogeTime
intamount, positionProfitLoss
public:
void
hereinafter abbreviated
}
CList hogeList;
voidsetToList(){
HogeClass*hoge=new HogeClass(
"posId 1234"
, "20201010"
, 1000
, -49
);
hogeList.Add(hoge);
}
When you ask questions, write more information about your environment.
I'm not sure what "MT4" means, but let's say it's probably "MetaTrader4".
As far as MetaTrader 5 references are concerned, if you override CObject::Compare()
and compare it based on the desired member variable, you can use CList::Sort()
.
class Xxx:public CObject{
...
public:
virtual int Compare(const CObject*node, const int mode = 0) const override {
// To obtain a pointer from the node argument to Xxx, click
// Downcast with static_cast or dynamic_cast.
// Returns 0 if this object equals a node object.
// Returns -1 if this object is smaller than the node object.
// Returns 1 if this object is greater than the node object.
// It is not known what the argument mode is.
}
};
Before you ask a question, read the reference first.Regardless of major or small vendors, Japanese references can be translated incorrectly or out of date, so you can get more accurate information by reading the original English references.If you have high school knowledge, you can read technical English.
By the way, this library looks very similar to the old Microsoft Foundation Classes (MFCs), but from the standpoint of a fairly experienced C++ programmer, the overall design is quite strange.I think it's better not to use it unless there's a good reason.
545 rails db:create error: Could not find mysql2-0.5.4 in any of the sources
546 Who developed the "avformat-59.dll" that comes with FFmpeg?
683 When building Fast API+Uvicorn environment with PyInstaller, console=False results in an error
525 Uncaught (inpromise) Error on Electron: An object could not be cloned
© 2024 OneMinuteCode. All rights reserved.