Replies

goldspanner
15 Nov 2016, 01:33

If someone from Spotware could tell me what that error code means I would really appreciate it.

 

Thanks,

 

Alex


@goldspanner

goldspanner
21 Jul 2016, 22:34

RE:

lucian said:

Maybe you need:

 long volume =  Symbol.NormalizeVolume((Math.Floor(Account.Balance) * Account.Leverage) / trade_size);

Thanks! Yeah, I hadn't considered that at all


@goldspanner

goldspanner
18 Jul 2016, 01:12

RE: RE:

moneybiz said:

(double)long_position.StopLoss

StopLoss is nullable double which means it can be null. Correct your logic to handle "double?" data type.

Thanks! That fixed that one, although I'm still getting the same error from here as well - any ideas?:

 

protected override void OnBar()
        {
            var long_position = Positions.Find(label, Symbol, TradeType.Buy);
            var short_position = Positions.Find(label, Symbol, TradeType.Sell);

            if (long_position != null)
                ModifyPosition(long_position, long_ATR_stop(long_position.StopLoss), null);
            else if (long_position == null && long_crossover() == true && long_bias() == true && above_avg_vol() == true && ADX_long_ok() == true)
            {
                open_long_position();
            }

            if (short_position != null)
                ModifyPosition(short_position, short_ATR_stop(short_position.StopLoss), null);
            else if (short_position == null && short_crossover() == true && short_bias() == true && above_avg_vol() == true && ADX_short_ok() == true)
            {
                open_short_position();
            }
        }

Thanks

 


@goldspanner

goldspanner
15 Jul 2016, 23:04

RE:

coolnck2003 said:

    Due to servers always lagging at 00.00 hours how do i change from UTC + 0 to UTC +1 or + 2?. 

 

changing the bottom here TimeZones.UTC+2 doesnt seem to work.

 

 

 [Robot(TimeZone = TimeZones.UTC, AccessRights = AccessRights.None)]
    public class NCStrategyA : Robot
    {

 

 

You can use TimeZones.CentralEuropeStandardTime which is equivalent to UTC+2.

If you just type in 'TimeZones.' it should come up with a list of all the possible timezones - there's a short description for each which gives you the equivalent in GMT. From that you should be able to work out which one(s) you need. GMT at the moment is UTC+1.


@goldspanner

goldspanner
13 Jul 2016, 00:27

RE:

Waxy said:

look it up with history, you can do:

            foreach (var hist in History)
            {
                if (hist.ClosingPrice == 1)
                {
                    //Do Stuff
                }
            }
            //
            HistoricalTrade _hist = History.FindLast("Label");
            Print(_hist.ClosingPrice);
            //
            HistoricalTrade[] _histlist = History.FindAll("Label");
            Print(_hist.ClosingPrice);

 

Thanks! Much appreciated


@goldspanner