Topics
16 Nov 2023, 07:42
 1089
 1
15 Nov 2023, 10:36
 1968
 16
Replies

Spotware
28 Jan 2014, 11:09

To be able to receive email at the opening of each new position you would have to subscribe an event that is triggered on opening of a new position:

    protected override void OnStart()
    {
        Positions.Opened += PositionsOnOpened;

    }

Then use code similar to that example to send a notification in the subscribed event:

    private void PositionsOnOpened(PositionOpenedEventArgs args)
    {
        Position position = args.Position;
        string emailBody = string.Format("Position {0} {1} Opened at {2}",position.Volume, 
                                         position.TradeType, position.EntryPrice);
        string subject = string.Format("RF P{0}", Positions.Count);
        Notifications.SendEmail("from@somewhere.com", "to@somewhere.com", subject, emailBody);
    }

 


@Spotware

Spotware
28 Jan 2014, 10:29

Thank you for the suggestion. We will provide such functionality in the future.


@Spotware

Spotware
28 Jan 2014, 09:25

Thank you for sending us the information. We will investigate this.


@Spotware

Spotware
27 Jan 2014, 12:24

Please send us troubleshooting information by pressing CTR+SHIFT+ALT+T on your application. 


@Spotware

Spotware
27 Jan 2014, 10:15

Please try to refresh the chart and let us know if the problem persists.


@Spotware

Spotware
27 Jan 2014, 10:04

The difference is that the old API methods are using asynchronous execution whereas ExecuteMarketOrder uses synchronous execution.

If you want to compare the two you can use ExexcuteMarketOrderAsync which uses asynchronous execution. Bear in mind that if you used OnPositionOpened with Trade.CreateBuyMarketOrder, you will have to define a callback method for ExecuteMarketOrderAsync that will be invoked when the position opens.
For instance:

protected override void OnStart()
{
    ExecuteMarketOrderAsync(TradeType.Buy, Symbol, 10000, "My Label", OnExecuted);
}
 
private void OnExecuted(TradeResult result)
{
    if (result.IsSuccessful)
    {
        Print("Position created entry price: {0}", result.Position.EntryPrice);
    }
    else
    {
        Print("Failed to create position");
    }
}

Please read  /forum/whats-new/1937 as well as /api/guides/trading_api for more information.


@Spotware

Spotware
26 Jan 2014, 17:27

This problem has been fixed.


@Spotware

Spotware
26 Jan 2014, 12:47

We can not reproduce this issue. Do you observe this issue with some specific cBots?

Please send us complete code to engage@spotware.com so we will be able to investigate it.


@Spotware

Spotware
26 Jan 2014, 11:23

We do not have plans to support inheritance of Parameters from base class. As a workaround you can declare parameter in base class as virtual property and override it in the inherited class.

Base class:

    public class BaseCBot : Robot
    {
        [Parameter(DefaultValue = 10)]
        public virtual double Parameter { get; set; }

Inherited class:

    public class NewcBot : BaseCBot
    {
        [Parameter()]
        public override double Parameter { get; set; }

 


@Spotware

Spotware
26 Jan 2014, 10:56 ( Updated at: 21 Dec 2023, 09:20 )

The problem has been identified and will be fixed as soon as possible. While you are not able to select .dll files in "Add Reference" dialog, please use text references in the header of source code:


@Spotware

Spotware
25 Jan 2014, 20:38

Since now cBots and indicators can be loaded from .algo files only.  Please recompile your algorithms using cAlgo.

It is still possible to reference custom .dll files from your algorithms.

Now we are preparing integration with Visual Studio in the native way. You will be able to execute “Edit in Visual Studio” command from context menu of cBot or Indicator.

We apologize for any inconvenience.


@Spotware

Spotware
24 Jan 2014, 16:11

Based on the logs you sent us it seems that the specific symbol was not active during those hours. Please contact your broker for further inquiries.


@Spotware

Spotware
24 Jan 2014, 12:55

This may be implemented but it is not in our near future plans.


@Spotware

Spotware
24 Jan 2014, 12:49

Tick charts have been implemented but are not available yet. 


@Spotware

Spotware
24 Jan 2014, 12:47

We will probably not add 10 seconds but tick charts will be available.


@Spotware

Spotware
24 Jan 2014, 11:52

Thank you for the suggestion. We will implement this in the future. For the time being you may use a different position on the chart for the messages. Let us know if you require help doing that.


@Spotware

Spotware
24 Jan 2014, 11:00

Thank you for reporting this. We will investigate it.


@Spotware

Spotware
24 Jan 2014, 10:24

The algo files are encrypted but we cannot disclose the encryption algorithm.


@Spotware

Spotware
24 Jan 2014, 10:19

We do not plan to publish those indicators.


@Spotware

Spotware
23 Jan 2014, 14:22

We apologize for any inconvenience. We kindly ask you to press Shift+Ctrl+Alt+T. It will send us troubleshooting information.


@Spotware