help me,my code error

Created at 05 Jan 2015, 06:28
How’s your experience with the cTrader Platform?
Your feedback is crucial to cTrader's development. Please take a few seconds to share your opinion and help us improve your trading experience. Thanks!
KH

khoabau

Joined 30.12.2014

help me,my code error
05 Jan 2015, 06:28


using System;

using System.Linq;

using cAlgo.API; 

using cAlgo.API.Indicators;

using cAlgo.API.Internals;

using cAlgo.Indicators;

namespace cAlgo

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

{ [Parameter(DefaultValue = 0.0)] public double Parameter { get; set; }

[Parameter("take profit(pips)", DefaultValue=10,MinValue=1)] public int takeProfit{get;set;}

protected override void OnPendingOrderCreated(PendingOrder newOrder) {Print ("Pending order with ID {0} was created.",newOrder .Id); }

protected override void OnPositionClosed(Position closedPosition) { // Put your initialization logic here }

protected override void OnTick()

{if(Position==ClosePosition) return; repeatOrder==OnPendingOrderCreated // Put your core logic here } protected override void OnStop() { // Put your deinitialization logic here } } }


@khoabau
Replies

deklin
06 Jan 2015, 00:03

Re: help me,my code error

This works with no errors:

using System;
using System.Linq;
using cAlgo.API;
using cAlgo.API.Indicators;
using cAlgo.API.Internals;
using cAlgo.Indicators;

namespace cAlgo
{
    [Robot(TimeZone = TimeZones.UTC, AccessRights = AccessRights.None)]
    public class NewcBot : Robot
    {
        [Parameter(DefaultValue = 0.0)]
        public double Parameter { get; set; }

        [Parameter("take profit(pips)", DefaultValue = 10, MinValue = 1)]
        public int takeProfit { get; set; }

        protected override void OnPendingOrderCreated(PendingOrder newOrder)
        {
            Print("Pending order with ID {0} was created.", newOrder.Id);
        }

        protected override void OnPositionClosed(Position closedPosition)
        {
        }


        protected override void OnTick()
        {
            if (1 == 2)
                return;
        }
        protected override void OnStop()
        {
        }
    }
}

If you want it to do something else you will have to be more specific.


@deklin