Topics
Replies
rick2010
26 Nov 2024, 00:14
( Updated at: 26 Nov 2024, 06:11 )
I use these guys https://lumens.llc/
Basically you send your Trading View alert to their system and it will execute it on your cTrader account.
They can also send your alerts to Discord or Telegram if you want to sell your trading signals.
@rick2010
rick2010
26 Nov 2024, 00:07
RE: How to calculate lot sizing from one market to another?
PanagiotisCharalampous said:
Hi there,
I did not understand what calculation you are trying to do. Can you elaborate a bit more, providing us with some examples?
Best regards,
Panagiotis
How can I find out the min lot size, max lot size, and lot step for a given symbol?
@rick2010
rick2010
21 Sep 2024, 12:51
RE: RE: RE: RE: RE: RE: RE: Check if position has already been opened and closed?
PanagiotisCharalampous said:
Yes it should be added instantly
Ok its exactly what I was looking for… Thanks
HistoricalTrade trade = History.FindLast(tradeLabel);
if(trade != null)
return true; // trade is closed
@rick2010
rick2010
20 Sep 2024, 15:10
( Updated at: 21 Sep 2024, 06:09 )
RE: RE: RE: RE: RE: Check if position has already been opened and closed?
Thanks… so as soon as a trade is closed it is instantly added to the historical? If it's instant this solution will work…. but if there is a delay of say more than 1 second then I'll have to keep them in a list in my code.
PanagiotisCharalampous said:
Check the link below
https://help.ctrader.com/ctrader-algo/references/Trading/History/History/#examples
@rick2010
rick2010
20 Sep 2024, 13:23
RE: RE: RE: Check if position has already been opened and closed?
PanagiotisCharalampous said:
There is no option to access closed positions. You can only access past deals through History. Nevertheless if you want the information to persist between cBot restarts, you can always save it in a file
Do you have a code example of getting a trade out of history? Can it be done using a name or id? TIA
@rick2010
rick2010
19 Sep 2024, 14:14
( Updated at: 20 Sep 2024, 05:20 )
RE: Check if position has already been opened and closed?
PanagiotisCharalampous said:
Hi there,
You can track the closed positions using the Positions.Closed event. There you can add the closed positions in a collection as the one you posted above.
Best regards,
Panagiotis
Thanks… I don't care about the event, I need to be able to look up a history of closed/filled trades. For example before placing a trade for id XYZ123 I first need to make sure that trade id XYZ123 hasn't already been opened and closed… this is to prevent duplicate trades from occurring. And if I just add them to a collection I'll lose that collection of closed trades next time the cBot is restarted which will allow duplicate trades to occur. TIA
@rick2010
rick2010
19 Aug 2024, 12:58
( Updated at: 19 Aug 2024, 13:03 )
RE: How to find a specific pending market order?
PanagiotisCharalampous said:
Hi there,
Pending orders are only limit, stop and stop limit orders. A market order is not a pending order.
Best regards,
Panagiotis
MetaTrader has a way to find orders before they actually become an open position. I need to do the same with cTrader. If I put on several async market orders all at once I need to be able to check if they've been filled otherwise I get duplicates. I don't want to use callbacks. I need to be able to look them up by their custom label. Something like my example:
foreach(Order order in SomeListOfUnfilledOrders) {
if(order.Label == “order123”)
return true;
}
@rick2010
rick2010
17 Aug 2024, 21:04
( Updated at: 19 Aug 2024, 05:19 )
RE: Need examples on how to: OPEN, CLOSE, MODIFY
firemyst said:
Hi Rick:
Simple Google search gives you more than enough results with examples returned:
- https://help.ctrader.com/ctrader-algo/articles/for-developers/cbot-trading-operations/
- https://clickalgo.com/ctrader-market-orders
Thanks!
@rick2010
rick2010
14 Aug 2024, 17:46
( Updated at: 15 Aug 2024, 05:20 )
RE: RE: RE: RE: RE: RE: Calling DLL functions help.
PanagiotisCharalampous said:
rick2010 said:
rick2010 said:
PanagiotisCharalampous said:
rick2010 said:
PanagiotisCharalampous said:
Hi there,
cBots are based on .Net. Therefore you can only call dll files based on managed code. If your dll is based on managed code, you should be able to use it.
Best regards,
Panagiotis
Thanks for the reply. I figured that was the case. I got a DLL written in managed C/C++. I need to be able to call this DLL from the cBot. I guess the only way to do that is to create a .Net DLL proxy that will call my C++ DLL?
Check the article below. It should help
https://learn.microsoft.com/en-us/dotnet/framework/interop/consuming-unmanaged-dll-functions
Thanks
I created a .NET DLL wrapper class that calls my unmanaged C++ DLL functions ok. I added the code below to the cBot and it compiles fine in cTrader but when I run the cBot it says it can't find the DLL even though the DLL is in the same directory?
internal static class NativeMethods {
[DllImport("Client.dll", CallingConvention = CallingConvention.Cdecl)]
internal static extern bool connClient(uint id, char[] username, char[] password);
}13/08/2024 22:06:42.127 | Info | CBot instance [Client_CBOT, EURUSD, h1] started.
13-08-2024 22:06:42.908 | Error | Crashed in OnStart with DllNotFoundException: Unable to load DLL 'Client.dll' or one of its dependencies: The specified module could not be found. (0x8007007E)Any ideas? Do I have to use the .NET DLL wrapper… doesn't make sense to do that when cBot is built in .NET?
Make sure your dll is copied to the output directory. Check the Copy Local property and make sure is set to true
Thanks but can you attach a bigger screenshot? I don't know where that setting is…
@rick2010
rick2010
13 Aug 2024, 22:10
( Updated at: 14 Aug 2024, 09:58 )
RE: RE: RE: RE: Calling DLL functions help.
rick2010 said:
PanagiotisCharalampous said:
rick2010 said:
PanagiotisCharalampous said:
Hi there,
cBots are based on .Net. Therefore you can only call dll files based on managed code. If your dll is based on managed code, you should be able to use it.
Best regards,
Panagiotis
Thanks for the reply. I figured that was the case. I got a DLL written in managed C/C++. I need to be able to call this DLL from the cBot. I guess the only way to do that is to create a .Net DLL proxy that will call my C++ DLL?
Check the article below. It should help
https://learn.microsoft.com/en-us/dotnet/framework/interop/consuming-unmanaged-dll-functions
Thanks
I created a .NET DLL wrapper class that calls my unmanaged C++ DLL functions ok. I added the code below to the cBot and it compiles fine in cTrader but when I run the cBot it says it can't find the DLL even though the DLL is in the same directory?
internal static class NativeMethods {
[DllImport("Client.dll", CallingConvention = CallingConvention.Cdecl)]
internal static extern bool connClient(uint id, char[] username, char[] password);
}
13/08/2024 22:06:42.127 | Info | CBot instance [Client_CBOT, EURUSD, h1] started.
13-08-2024 22:06:42.908 | Error | Crashed in OnStart with DllNotFoundException: Unable to load DLL 'Client.dll' or one of its dependencies: The specified module could not be found. (0x8007007E)
Any ideas? Do I have to use the .NET DLL wrapper… doesn't make sense to do that when cBot is built in .NET?
@rick2010
rick2010
12 Aug 2024, 21:16
( Updated at: 13 Aug 2024, 04:58 )
RE: RE: RE: Calling DLL functions help.
PanagiotisCharalampous said:
rick2010 said:
PanagiotisCharalampous said:
Hi there,
cBots are based on .Net. Therefore you can only call dll files based on managed code. If your dll is based on managed code, you should be able to use it.
Best regards,
Panagiotis
Thanks for the reply. I figured that was the case. I got a DLL written in managed C/C++. I need to be able to call this DLL from the cBot. I guess the only way to do that is to create a .Net DLL proxy that will call my C++ DLL?
Check the article below. It should help
https://learn.microsoft.com/en-us/dotnet/framework/interop/consuming-unmanaged-dll-functions
Thanks
@rick2010
rick2010
10 Aug 2024, 15:42
( Updated at: 11 Aug 2024, 07:12 )
RE: Calling DLL functions help.
PanagiotisCharalampous said:
Hi there,
cBots are based on .Net. Therefore you can only call dll files based on managed code. If your dll is based on managed code, you should be able to use it.
Best regards,
Panagiotis
Thanks for the reply. I figured that was the case. I got a DLL written in managed C/C++. I need to be able to call this DLL from the cBot. I guess the only way to do that is to create a .Net DLL proxy that will call my C++ DLL?
@rick2010
rick2010
28 Nov 2024, 18:43
RE: RE: RE: How to calculate lot sizing from one market to another?
PanagiotisCharalampous said:
Thanks
@rick2010