Show me, then, where in the predefined variables are the other types of the basic structure I cited?
I'm not talking specifically about this structure, but about this technique in general.
For example, here is the structure of position properties:
struct Position_Properties
{
datetime gdt_Expiration; // Срок истечения отложенного ордераdatetime gdt_OpenTime; // Время открытия выбранной позицииdouble gd_OpenPrice; // Цена открытияdouble gd_Lots; // Объём позиции на открытиеdouble gd_CurSL; // Текущий Stop Loss выбранной позицииdouble gd_NewSL; // Новый Stop Loss выбранной позицииdouble gd_CurTP; // Текущий Take Profit выбранной позицииdouble gd_NewTP; // Новый Take Profit выбранной позицииint gi_CurTicket; // Тикет выбранного ордераint gi_Type; // Тип торговой операцииint gi_Slippage; // Максимально допустимое отклонение цены для рыночных ордеровint gi_Magic; // Магический номерstring gs_Comment; // Комментарийstring gs_Symbol; // Наименование фин. инструмента, с которым производится операцияulong gu_Duration; // Длительность позиции в секундах
} SPos;
Also predefined variables? There are no such predefined variables!
FAQ: Well, that's a good place to start, based on the structure you gave me in the first post.
Yeah, I get it. So what options do I have? I'm really stuck on this point. I need some solution at least. How to pass these variables to classes? I want convenience, that's why I'm asking...
Why don't you make an instance of the structure extern?
It's not written anywhere about such moments. How do I know how to do it? I don't know any of the programmers I know. And some of them still manage to get on the forum and make fun of me.
Right?
struct Position_Properties
{
staticdatetime gdt_Expiration; // Срок истечения отложенного ордераstaticdatetime gdt_OpenTime; // Время открытия выбранной позицииstaticdouble gd_OpenPrice; // Цена открытияstaticdouble gd_Lots; // Объём позиции на открытиеstaticdouble gd_CurSL; // Текущий Stop Loss выбранной позицииstaticdouble gd_NewSL; // Новый Stop Loss выбранной позицииstaticdouble gd_CurTP; // Текущий Take Profit выбранной позицииstaticdouble gd_NewTP; // Новый Take Profit выбранной позицииstaticint gi_CurTicket; // Тикет выбранного ордераstaticint gi_Type; // Тип торговой операцииstaticint gi_Slippage; // Максимально допустимое отклонение цены для рыночных ордеровstaticint gi_Magic; // Магический номерstaticstring gs_Comment; // Комментарийstaticstring gs_Symbol; // Наименование фин. инструмента, с которым производится операцияstaticulong gu_Duration; // Длительность позиции в секундах
};
extern Position_Properties::SPos;
Position_Properties::gdt_Expiration = 0;
Position_Properties::gdt_OpenTime = 0;
Position_Properties::gd_OpenPrice = 0.0;
Position_Properties::gd_Lots = 0.0;
Position_Properties::gd_CurSL = 0.0;
Position_Properties::gd_CurTP = 0.0;
Position_Properties::gd_NewSL = 0.0;
Position_Properties::gd_NewTP = 0.0;
Position_Properties::gi_CurTicket;
Position_Properties::gi_Type;
Position_Properties::gi_Slippage = 3;
Position_Properties::gi_Magic;
Position_Properties::gs_Comment;
Position_Properties::gs_Symbol;
Position_Properties::gu_Duration:
It doesn't say anything about such moments. How do I know how to do it? I don't know any of the programmers I know. And some of them still manage to get on the forum and poke fun at me.
Wouldn't it be easier to use predefined variables and standard structures?
Show me, then, where in the predefined variables are the other types of the basic structure I cited?
I'm not talking specifically about this structure, but about this technique in general.
For example, here is the structure of position properties:
Also predefined variables? There are no such predefined variables!
Well, that's a good place to start, based on the structure you gave me in the first post.
Yeah, I get it. So what options do I have? I'm really stuck on this point. I need some solution at least. How to pass these variables to classes? I want convenience, that's why I'm asking...
I have structures which need only one instance. Of course, it's not recommended to create several objects in different classes of these structures.
So I came to the conclusion that, in this case, the most reasonable way is to use thesingleton pattern.
Right?
Wrong.
Use the externt modifier.
Right?
Right?
strange logic.
but don't you want to make an instance of the structure extern?
strange logic.
Why don't you make an instance of the structure extern?
It's not written anywhere about such moments. How do I know how to do it? I don't know any of the programmers I know. And some of them still manage to get on the forum and make fun of me.
Right?
It doesn't say anything about such moments. How do I know how to do it? I don't know any of the programmers I know. And some of them still manage to get on the forum and poke fun at me.
Right?
What is this?