Topics
Replies
Spotware
01 Oct 2013, 14:50
Yes. Version with the fix is already released for our demo build. You can download it from www.spotware.com
@Spotware
Spotware
30 Sep 2013, 13:01
( Updated at: 15 Jan 2024, 14:50 )
RE: RE:
Balena said:
1.
i look to trade every x number of minutes based on
protected override void OnPositionOpened(Position openedPosition)
{
lastExecutedTime = Server.Time;so how would I know what lastExecutedTime = ? (code please)
After you restart the robot all variables will be reset. The only information you can retrieve is open position information. Therefore you can use EntryTime instead. In order to find the positions of a specific robot you may assign Labels to these positions when the trade Requests are sent. Then retrieve the positions by their Label and find their entry time. The latest position will have the latest entry time. If the position closes the entry time will not be available.
/// <summary> /// If there is no position, returns 01/01/0001 00:00:00 /// </summary> protected DateTime LastExecutedTime { get { Position lastOrDefault = Account.Positions.LastOrDefault(position => position.Label == RobotLabel); return lastOrDefault != null ? lastOrDefault.EntryTime : new DateTime(); } }
the Linq namespace is required for the above code
using System.Linq;
2.
if i have a max position size of 10 and I have 5 befor the disconnect how do I tell the robot this on restart? (code please)
The same as above, use Labels and count how many positions have the Label that is set with this robot.
[Labels and a New Method to Create Orders]
@Spotware
Spotware
30 Sep 2013, 10:53
( Updated at: 21 Dec 2023, 09:20 )
To include an indicator in a robot you can start by looking at the examples in the platform. For instance:
- "Sample Breakout Robot" uses the "BollingerBands" build in indicator and
- "Sample Robot Reference SMA" uses the "Sample SMA" custom indicator
If you need further help referencing indicators you can start a new thread in the appropriate section of the forum Indicator Development Support
Levels are horizontal lines drawn at the y value indicated by the values in parenthesis.
The above will display three level (horizontal) lines at values 25, 50 and 75.
@Spotware
Spotware
24 Sep 2013, 12:31
( Updated at: 23 Jan 2024, 13:16 )
RE: RE:
andromeda said:
How that index relates to instantiated m10 or m1 for that matter ?
How often Calculate method is called by who and when and what is index relative to ?
(I know it is called at some irregular intervals in real time and any time a graph point is evaluated,
but I cannot correlate it to the last "10 minute" or "one minute" bar.)
The Calculate method is called on each historical bar in the series the instance is attached to (i.e. EURUSD H1). Once it reaches real time, it is called on each incoming tick of that symbol, as well as on each incoming tick of any other symbols for which the series are retrieved.
The "index" that is the parameter to the Calculate method, is the index of the series that the instance is attached to. The series of other timeframes / symbols have different indexes. So, to get the index of a specific series you would need to use a method such as GetIndexByDate (Described in the example above: [Multi-timeframe moving average])
private int GetIndexByDate(MarketSeries series, DateTime time) { for (int i = series.Close.Count - 1; i > 0; i--) { if (time == series.OpenTime[i]) return i; } return -1; } } }
Descriptions are minimalistic. A simple question like Print method nowhere describes where
does the print go to. So far I know it goes o a log file, but could not find the log anywhere.
I find cAlgo exeptionally cool tool but I am having trouble to get started due to insufficient
description. C# is not an issue here but general concept of all classes and objects and how they tie together.
The Print method prints to the Log within the platform, not a log file. It is the last tab in the bottom panel of the chart view.
We are preparing a manual for cAlgo with more detailed descriptions of all the main classes in the API.
@Spotware
Spotware
24 Sep 2013, 10:30
If you are referring to lines created using ChartObjects such as ChartObjects.DrawHorizontalLine then this cannot be changed at the moment. You can only set the color thickness and line style from the code.
If you are referring to the horizontal lines added on the chart manually from the toolbox, then you can right click on the line and a settings window will pop up to allow you to make modifications to the line appearance.
@Spotware
Spotware
23 Sep 2013, 16:52
You can set the AutoRescale property to false.
[Indicator(IsOverlay = true, AutoRescale = false)] public class EnvelopeChannels : Indicator
/api/indicatorattribute/autorescale
@Spotware
Spotware
01 Oct 2013, 16:50
RE:
fx_trader said:
Right now you can do it using labels. If you specify label for an order position will inherit this label.
cAlgo will not notify your robot in case pending order no longer exists.
In this case trade server will fill your order with the current market price.
In your case it would be perfect to use modify order command, but it's not supported now. The only consistent way to implement such robot is to emulate stop orders in cAlgo, I mean to send market orders when spot price reaches certain level and use VPS to minimize possible latency. Note that if you use market orders you can also specify maximum slippage in pips.
We currently work on new trading API that will be much more flexible and allow to modify pending orders and handle errors properly.
@Spotware