Topics
Replies
Spotware
09 Jul 2014, 16:10
Thank you for your ideas, we will consider it. Additionally you can post your ideas to vote.spotware.com.
@Spotware
Spotware
09 Jul 2014, 14:40
Dear lithast,
If it is possible please send code of your cBot and Indicator to engage@spotware.com. It will help us to troubleshoot the issue.
@Spotware
Spotware
09 Jul 2014, 10:24
( Updated at: 21 Dec 2023, 09:20 )
cAlgo.API is not thread safe. If you access cAlgo.API objects from different thread an exception could be thrown. If you do not handle exception in your thread, entire application will crash.
54 second delay
08/07/2014 23:05:54.415 | 8/07/2014 11:05:00 PM - OnBar called
08/07/2014 23:05:54.415 | 29/05/2014 11:05:00 PM - Sync OnBar complete
08/07/2014 23:05:59.704 | 8/07/2014 11:05:00 PM - Async OnBar complete
OnBar method is invoked on first tick of new bar. The above log shows that no ticks were occurred during last 54 seconds. You can use OnTimer handler instead of OnBar:
@Spotware
Spotware
08 Jul 2014, 14:56
cTrader ID allows you to configure Email Alerts. We will add more functionality related to cTrader ID in the future.
All July 2014 updates can be found by the following link:
http://www.spotware.com/about/news-updates/ctrader-and-calgo-updates---july-2014/637
@Spotware
Spotware
08 Jul 2014, 12:37
No, we do not plan. You can post your idea to vote.spotware.com. If it collects enough votes we will consider it.
@Spotware
Spotware
08 Jul 2014, 10:06
3. When I make an order, then its possible to change StopLoss and TakeProfit of this order. On MT4 there was a possible Stoploss and TakeProfit (pips away from current price). Is there something in cTrader and how to get this possible Stoploss and TakeProfit
There is no restriction for minimal pips away from spot prices.
6. How much money i have to possess in mu account to buy the minimum 10k eurusd, or 10k gold ... etc ... newbee question.
In order to calculate required margin you can use the following formula:
private double GetRequiredMarginForLongPosition(long volume, Symbol symbol) { return volume / Account.Leverage * symbol.Ask * symbol.TickValue / symbol.TickSize; }
@Spotware
Spotware
08 Jul 2014, 09:19
Settings files are encrypted with Windows security key. After you re-installed the Windows, you got another security key. Therefore your settings file cannot be read by cAlgo.
We plan to add ability to save cBot settings to the file. You can vote for this feature: http://vote.spotware.com/forums/229166-ideas-and-suggestions-for-ctrader-and-calgo/suggestions/5392544-load-cbot-parameters-from-file.
@Spotware
Spotware
07 Jul 2014, 11:18
You can find Trading API guide by the following link: /api/guides/trading_api.
1. In MQL there is something called Magic Number that identify each order you place. Is there such thing in C#? If yes, any example of code for existing some placed order, or not. The idea is to avoid non stop ordering.
You can use Label parameter for such purposes. Example of usage label with ExecuteMarketOrder command:
ExecuteMarketOrder(TradeType.Buy, Symbol, 100000, "My unique label"); var position = Positions.Find("My unique label");
2. I need equivalent of iOpen(Symbol,1,0) in cAlgo OR the code that gives information for open, high, low, close for some symbol, in some minute (or minutes ago like in MQL), and in some period (for example M1).
You can use MarketData.GetSeries method:
var dailyEurGbpSeries = MarketData.GetSeries("EURGBP", TimeFrame.Daily); var dailyHigh = dailyEurGbpSeries.High.Last(0); var dailyLow = dailyEurGbpSeries.Low.Last(0);
3. How to collect tick quotes in memory. I suppose there is tick functions for that? In MQL i'm forced to collect every quote in array for future using?
There is an example: /forum/cbot-support/3049?page=1#2
3. I need come code to shows me the possible SL and TP for some placed order.
Sorry, but we do not understand the question.
4. I need a code for placing changes in SL and TP for some order.
var position = Positions.Find("my label"); if (position != null) { var newStopLossValue = Symbol.Bid - 15 * Symbol.PipSize; var newTakeProfitValue = Symbol.Bid + 20 * Symbol.PipSize; ModifyPosition(position, newStopLossValue, newTakeProfitValue); }
5. Of cource for observation needs, I need a code that places datas every tick in CSV file like ask(bid) quotes, server time (hour,minute, second, millisecond), connection speed to the server, current order (type (buy,sell),SL, TP, volume, magicnumber)
You can find an example of writing to a CSV file there: /algos/cbots/show/495. You will need to put your to code to the OnTick handler. You can retrieve prices from Symbol.Ask and Symbol.Bid properties. Server.Time property has DateTime value which stores hour, minute, second and millisecond. Connection speed is not available in the API. There is no current order entity in our API. You can enumerate all Positions with foreach instruction. All position properties are presented there: /api/reference/position.
6. A code to shows me what quantity of some pair I can order for the money i got.
Sorry, but we do not understand the question.
7. Is some code have compiled and source version in my installation? Where are they to have the ability to save it on other place? If compiled version exist, is it secure?
When you compile source code .algo file is created. If you do not perform "Build with Source Code" command, no source code will be included to the .algo file.
.algo files are encrypted and can be used on other machines without source code.
@Spotware
Spotware
07 Jul 2014, 10:12
No, we remove old source code file only if migration was successful.
You can see "Source code is not available" message if you removed [Robot] attribute from the source code file. In order to fix that you need to open your source code file in notepad and restore [Robot] attribute. You can find the source code file in the following folder: Documents\cAlgo\Sources\Robots\Robot Name\Robot Name\.
The problem with [Robot] attribute was already fixed. You don't need to add it anywhere, especially to the .algo files.
.algo files are binary and encrypted. By modifying it in notepad you can corrupt it. Please do not modify .algo files.
@Spotware
Spotware
04 Jul 2014, 15:55
RE: RE:
chiripacha said:
modarkat said:
This link could help you:
http://www.codeproject.com/Articles/383138/BadImageFormatException-x-i-x
I understad that ctrader runs smoothly on windows 7 64 bit? Is that correct?
Yes, cTrader supports Windows 7 64 bit
@Spotware
Spotware
03 Jul 2014, 11:50
RefreshData() method and Timer object have been added to the API
http://www.spotware.com/about/news-updates/ctrader-and-calgo-updates---july-2014/637
@Spotware
Spotware
03 Jul 2014, 11:49
RefreshData() method has been added to the API
http://www.spotware.com/about/news-updates/ctrader-and-calgo-updates---july-2014/637
@Spotware
Spotware
03 Jul 2014, 11:46
Timer object has been added to the API:
http://www.spotware.com/about/news-updates/ctrader-and-calgo-updates---july-2014/637
@Spotware
Spotware
10 Jul 2014, 09:16
RE:
Balena said:
It is only visual change
@Spotware