Topics
Replies
Spotware
06 Dec 2013, 17:22
Order comments, partial close of positions and many more features are now available in the new trading API. Please see: /forum/whats-new/1937
@Spotware
Spotware
06 Dec 2013, 17:19
Partial close of positions are now available in the new trading API. Please see: /forum/whats-new/1937
@Spotware
Spotware
06 Dec 2013, 17:19
Partial close of positions are now available in the new trading API. Please see: /forum/whats-new/1937
@Spotware
Spotware
06 Dec 2013, 17:17
Order comments and partial close of positions are now available in the new trading API. Please see: /forum/whats-new/1937
@Spotware
Spotware
06 Dec 2013, 16:56
The correct time setting for the expiration should be based on server time instead of local time.
The syntax for the order commands expects the arguments in a certain order. If arguments are to be ommited, a null should be specified in their place.
DateTime expiry = Server.Time.AddMinutes(5); PlaceLimitOrder(TradeType.Buy, Symbol, 10000, Symbol.Bid - 1.5 * Symbol.PipSize, null, null, null, expiry);
See more examples here: /api/robot/placelimitorder-6205
@Spotware
Spotware
05 Dec 2013, 12:36
For example one that looks for triggers that take place during certain times such as the last 30 minutes of New York trading. Knowing the selected timezone for the chart on which the indicator is displayed is necessary.
You do not need selected chart timezone for this indicator. Just specify NY time zone for the indicator and all timestamps will be present in this timezone, so you can easily check that time is between 16:30 and 17:00 NY:
[Indicator(IsOverlay = false, TimeZone = TimeZones.EasternStandardTime)] public class NYTimeIndicator : Indicator { [Output("Main")] public IndicatorDataSeries Result { get; set; } public override void Calculate(int index) { var time = MarketSeries.OpenTime[index].TimeOfDay; if (time >= new TimeSpan(16, 30, 0) && time < new TimeSpan(17, 0, 0)) Result[index] = 1; else Result[index] = 0; } }
The Price scale is needed when placing an arrow above or below a price bar. Vertical positioning is determined by price. I could simply apply an offset using a multiple of Symbol.PipSize. The trouble comes in when changing TimeFrames. On a one hour chart 5 pips might have the arrow look like it is sitting on the bar. Whereas on a 1M chart 5 pips might have the arrow off of the screen. Now imagine trying to place the arrow around a BollingerBand indicator. Being able to fine tune exactly where the arrow is displayed would be ideal. It would allow the arrow to be placed in relatively the same position regardless of the chart timeframe.
So you want to draw an arrow let's say 5 pixels above the bar. You are right, this is impossible now. But if we implement access to the chart scale (this is not easy for us right now), we will have to run your code every time the chart is scrolled or updated, which is too frequent. So, we recommend to use text for such drawings:
[Indicator(IsOverlay = true, TimeZone = TimeZones.UTC)] public class Arrows : Indicator { public override void Calculate(int index) { if (MarketSeries.High[index - 1] > MarketSeries.High[index] && MarketSeries.High[index - 1] > MarketSeries.High[index - 2]) { ChartObjects.DrawText("arrow" + index, "▼", index - 1, MarketSeries.High[index - 1], VerticalAlignment.Top); } } }
But in the future we are going to implement a special method to draw arrows and other common shapes.
Visible bars are needed as a work around to being able to display two indicators in the same window pane. Having a separate pane for multiple indicators can take up valuable space.
The example is rather clear. To be honest, we prefer to provide proper solution here, not API workarounds. But we will also consider implementing your suggestions.
Please let us know what you think about it.
@Spotware
Spotware
05 Dec 2013, 11:55
We've checked your code and got the following result:
05/12/2013 04:44:18.686 | Robot "TestOpenPosition" was started successfully for GBPUSD, m1. 05/12/2013 04:45:00.256 | Executing Market Order to Buy 10k GBPUSD (SL: 30, TP: 30, MR: 1) 05/12/2013 04:45:00.490 | → Executing Market Order to Buy 10k GBPUSD (SL: 30, TP: 30, MR: 1) SUCCEEDED, Position PID676961 05/12/2013 04:45:00.490 | Position opened. Label: Test. ID: 676961. Direction: Buy. Volume: 10000. Entry: 1.6351. T/P: 1.6381. S/L: 1.6321. Margin Level: 10396%.
For now we can not figure out the reason of the behavior you have.
@Spotware
Spotware
09 Dec 2013, 10:43
Starting from the next version algo files will be protected. Also, algo files will be automatically installed, so it will be easier to distribute them.
All referenced dll's will be included into the algo file.
@Spotware