What's wrong with me? How can I make only open orders be considered? This code also captures partially closed orders, which I do not need
Actually I do not understand it a bit. Why does the function of the int type return a value of the string type? It doesn't throw an error during compilation?
При создании графического объекта функцией ObjectCreate() необходимо указать тип создаваемого объекта, который может принимать одно из значений перечисления ENUM_OBJECT. Дальнейшие уточнения свойств созданного объекта возможно с помощью функций по работе с графическими объектами.
Существуют 11 видов событий, которые можно обрабатывать с помощью функции предопределенной функции OnChartEvent(). Для пользовательских событий предусмотрено 65535 идентификаторов в диапазоне от CHARTEVENT_CUSTOM до CHARTEVENT_CUSTOM_LAST включительно. Для генерации пользовательского события необходимо использовать функцию EventChartCustom...
But I tried to translate Time, Price with ChartTimePriceToXY into coordinates. I was able to draw in the right place, but again, when scrolling the chart, it stands in place, which doesn't work for me.
It's the same story with BitMap, because it's attached by coordinates, which means all BitMaps will stand in place when scrolling the chart, it doesn't suit me.
Then overall question, is it possible to implement my idea I described above?
But I tried to translate Time, Price with ChartTimePriceToXY into coordinates. I was able to draw in the right place, but again, when scrolling the chart, it stands in place, which doesn't work for me.
It's the same story with BitMap, because it's attached by coordinates, which means all BitMaps will stand in place when scrolling the chart, it doesn't suit me.
Then overall question, is it possible to implement my idea that I described above?
lstrcpyW () defined in winbase.mqh:string lstrcpyW(ushort &string1[],const string string2);
this code copies string to clipboard, how do I change it to make it work
//+------------------------------------------------------------------+//| This piece of code will copy any text we want to the clipboard |//+------------------------------------------------------------------+/*
#import "kernel32.dll"
int GlobalAlloc(int Flags, int Size); long GlobalAlloc(uint flags,ulong bytes);
int GlobalLock(int hMem); long GlobalLock(HANDLE mem);
int GlobalUnlock(int hMem); int GlobalUnlock(HANDLE mem);
int GlobalFree(int hMem); long GlobalFree(HANDLE mem);
int lstrcpyW(int ptrhMem, string Text);
#import
#import "user32.dll"
int OpenClipboard(int hOwnerWindow); int OpenClipboard(HANDLE wnd_new_owner)
int EmptyClipboard(); int EmptyClipboard(void);
int CloseClipboard(); int CloseClipboard(void);
int SetClipboardData(int Format, int hMem); long SetClipboardData(uint format,HANDLE mem);
#import
*/#define GMEM_MOVEABLE 2#define CF_UNICODETEXT 13#include <WinAPI\winuser.mqh>
#include <WinAPI\winbase.mqh>
// Copies the specified text to the clipboard, returning true if successfulbool CopyTextToClipboard(string Text)
{
bool bReturnvalue = false;
long wnd_new_owner=0 ;
// Try grabbing ownership of the clipboard if (OpenClipboard(wnd_new_owner) != 0) {
// Try emptying the clipboardif (EmptyClipboard() != 0) {
// Try allocating a block of global memory to hold the text int lnString = StringLen(Text);
long hMem = GlobalAlloc(GMEM_MOVEABLE, lnString * 2 + 2);
if (hMem != 0) {
// Try locking the memory, so that we can copy into itlong ptrMem = GlobalLock(hMem);
if (ptrMem != 0) {
// Copy the string into the global memory
lstrcpyW(ptrMem, Text);
// Release ownership of the global memory (but don't discard it)
GlobalUnlock(hMem);
// Try setting the clipboard contents using the global memoryif (SetClipboardData(CF_UNICODETEXT, hMem) != 0) {
// Okay
bReturnvalue = true;
} else {
// Failed to set the clipboard using the global memory
GlobalFree(hMem);
}
} else {
// Meemory allocated but not locked
GlobalFree(hMem);
}
} else {
// Failed to allocate memory to hold string
}
} else {
// Failed to empty clipboard
}
// Always release the clipboard, even if the copy failed
CloseClipboard();
} else {
// Failed to open clipboard
}
return (bReturnvalue);
}
voidOnStart(){
bool re = false ;
re =CopyTextToClipboard("11111");
printf(re);
}
What's wrong with me? How can I make only open orders be considered? This code also captures partially closed orders, which I do not need
I have anOBJ_RECTANGLE object linked by price and time, not by coordinates.
И? That's correct. When you compress the timeline, the rectangle is also compressed. Is it logical? Are you struggling with logic?
Keep track of the shift in the graph.
И? That's right. When you shrink the timeline, the rectangle shrinks too. Is that logical? Are you struggling with logic?
Track the shift in the graph.
Please tell me which way to dig.
Please tell me which way to go.
You've quoted from my post exactly what I told you to do.
There are several types of objects that you can use for your purposes. What you are using now is definitely not the right one.
That leaves several options. And all of them are here, you just have to read and ask what you don't understand:
Please tell me which way to go.
The objects I have shown above and this:
The objects I showed above, and this:
I don't see an object to solve my problem, do you? Unless OBJ_TEXT supports a frame!?
I don't see an object to solve my problem, do you? Unless OBJ_TEXT if it supports the frame!?
Rectangle_label is what I need.
But I tried to translate Time, Price with ChartTimePriceToXY into coordinates. I was able to draw in the right place, but again, when scrolling the chart, it stands in place, which doesn't work for me.
It's the same story with BitMap, because it's attached by coordinates, which means all BitMaps will stand in place when scrolling the chart, it doesn't suit me.
Then overall question, is it possible to implement my idea I described above?
Rectangle_label is what I need.
But I tried to translate Time, Price with ChartTimePriceToXY into coordinates. I was able to draw in the right place, but again, when scrolling the chart, it stands in place, which doesn't work for me.
It's the same story with BitMap, because it's attached by coordinates, which means all BitMaps will stand in place when scrolling the chart, it doesn't suit me.
Then overall question, is it possible to implement my idea that I described above?
Yes.
I gave you the help link for OnChartEvent()
Hi all, I have a problem with lstrcpyW () on MT5,
lstrcpyW () defined in winbase.mqh:string lstrcpyW(ushort &string1[],const string string2);
this code copies string to clipboard, how do I change it to make it work