Topics

Forum Topics not found

Replies

cAlgo_Fanatic
17 Apr 2013, 15:10

The reason the robot stops working is probably in this line:

if ((int) Server.Time.DayOfWeek == NewsDay && !_ordersCreated

ordersCreated is set to true when the first two pending orders are created and never set back to false. 

You probably want to set it back to false when you delete those orders, unless the logic intended is to create 2 pending orders and stop. In that case you may want to stop the robot by adding this line Stop();

right after you delete the orders.


@cAlgo_Fanatic

cAlgo_Fanatic
15 Apr 2013, 16:37

Typical price: (High + Low + Close)/3

Weighted: (Open + High + Low + Close) / 4


@cAlgo_Fanatic

cAlgo_Fanatic
15 Apr 2013, 15:06

Thank you for the suggestion.


@cAlgo_Fanatic

cAlgo_Fanatic
15 Apr 2013, 15:06

We will investigate this and let you know as soon as we find the cause of the error. Thank you for your patience.


@cAlgo_Fanatic

cAlgo_Fanatic
15 Apr 2013, 14:31 ( Updated at: 23 Jan 2024, 13:11 )

Hello,

For examples working with DateTime variables please see: Trading time interval, [timer display].

If you need further help please give us a few more details about the logic. In other words, do you mean Sell five hours (or six hours?) before the close of the market or the end of the trendbar?

 


@cAlgo_Fanatic

cAlgo_Fanatic
15 Apr 2013, 14:17

This is a bug that will be fixed soon. We apologize for any inconvenience.


@cAlgo_Fanatic

cAlgo_Fanatic
15 Apr 2013, 14:15

The broker's provided historical trendbars were used before that date whereas cTrader's ticks are used afterwards. There are a lot more ticks due to real liquidity.


@cAlgo_Fanatic

cAlgo_Fanatic
15 Apr 2013, 12:32

Please check the backtesting settings, you may choose which method you would like to use for the spread, fixed value, random or current live spread. If you are not using fixed value the spread will vary.


@cAlgo_Fanatic

cAlgo_Fanatic
15 Apr 2013, 12:26

We cannot provide an estimate at the moment. We apologize for this inconvenience.


@cAlgo_Fanatic

cAlgo_Fanatic
15 Apr 2013, 12:19

Are you trying to use an external library? If you want to post or send us the code at engage@spotware.com, it will speed up the process of identifying the error.


@cAlgo_Fanatic

cAlgo_Fanatic
15 Apr 2013, 12:08

You may code an indicator that shifts the SMA like:

/forum/calgo-reference-samples/733


@cAlgo_Fanatic

cAlgo_Fanatic
15 Apr 2013, 11:47

We cannot provide an estimate for multi-timeframes at the moment.


@cAlgo_Fanatic

cAlgo_Fanatic
15 Apr 2013, 11:44

Assign a global field to the starting account balance in the OnStart event.

Then at the beginning of the OnTick event call a method that compares the account equity to that field.

(Assuming that you want to close all account positions, not just the robots. If you want to close only the robots then the code would be different. Please see Labels)

    private double startingBalance;
    private const double BalancePercent = 0.10;

    protected override void OnStart()
    {
        startingBalance = Account.Balance;
    }
    protected override void OnTick()
    {
        CheckBalance();
        //...
    }

    private void CheckBalance()
    {            
        if (Account.Equity <= startingBalance * BalancePercent)
        {
            // close all account positions
            foreach (var pos in Account.Positions)
            {
                Trade.Close(pos);
            }
            Stop(); // Stop the robot
        }
    }




@cAlgo_Fanatic

cAlgo_Fanatic
15 Apr 2013, 09:48

There is a mistake in the code of the ATR that you downloaded. It doesn't build as is.

Correct this line:

 _ema = Indicators.ExponentialMovingAverage(_tempBuffer, Period); 

The Referenced files (ATR) should be build first. It may be that you have another ATR downloaded and build and it is using different syntax than this one.

Alternatively, locate the other ATR file that you have in your system and see what is the name of the Ouput variable. Replace "Result" in Supertrend with that name.

ATR 1 --> Output variable name is ATR

ATR 2  --> Output variable name is atr

 


@cAlgo_Fanatic

cAlgo_Fanatic
15 Apr 2013, 09:25

It seems that the settings file has been corrupted. Please follow the following instructions:

Start menu -> Run

In the run command text box Type %USERPROFILE%\Application Data 

find the Demo cTrader folder

Open the settings folder 

Delete the settings.xtr file

Start cTrader

 


@cAlgo_Fanatic

cAlgo_Fanatic
12 Apr 2013, 12:02

The previous reply was incorrect. There are no current plans for custom indicators for the cTrader Web platform. We apologize for this mistake.


@cAlgo_Fanatic

cAlgo_Fanatic
12 Apr 2013, 10:46

We cannot provide a time estimate at the moment.


@cAlgo_Fanatic

cAlgo_Fanatic
12 Apr 2013, 10:28

Those namespaces are not supported at the moment. We will see if they can be included in a future release.

cAlgo uses framework 4.0. There are no plans at the moment for upgrading to Framework 4.5.


@cAlgo_Fanatic

cAlgo_Fanatic
12 Apr 2013, 10:13

Please see this sample: Sample Trading Time

 


@cAlgo_Fanatic

cAlgo_Fanatic
11 Apr 2013, 11:47

Tick charts will be available in the future.

Alternatively, you may like to look at MarketDepth if you like to utilize that functionality.

If you have a specific algorithm you can post it and we will see if it is possible to implement currently or suggest modifications and help you with the code.


@cAlgo_Fanatic