Topics
Replies

marafi5
04 Dec 2013, 22:15

Hello

 "I made this code but its works only when I open it , after that it will not work automaticlly , I think that its needs a code line ''for'

 

namespace cAlgo.Robots
{

    [Robot(TimeZone = TimeZones.UTC)]
    public class SampleCloseProfitablePositions : Robot
    {
        protected override void OnStart()
        {
            foreach (var position in PendingOrders)
            {

                for (int i = 0; i > 1; i--)
                    if (Account.Equity >= 0)
                    {
                        CancelPendingOrder(position);
                    }

            }

        }

    }

}

 


@marafi5

marafi5
02 Dec 2013, 01:52

RE: RE:

Its showed to me in cAlgo this:

Error CS0116: A namespace cannot directly contain members such as fields or methods

 

Cerunnos said:

marafi5 said:

Hello

I need a help for making cBot for a small idea: If my account is making profit , all pending order should be deleted.

Thanks

if (Account.Equity >= startingBalance * BalancePercent)
{
  foreach (var order in PendingOrders)
  {
  CancelPendingOrder(order);
  }

}

 


@marafi5