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("Lot Size", DefaultValue = 0.01)]
public double lot { get; set; }
[Parameter("Positions nr.", DefaultValue = 100)]
public int nr { get; set; }
[Parameter("Buy ?")]
public bool buy { get; set; }
[Parameter("Sell ?")]
public bool sell { get; set; }
protected override void OnStart()
{
long volume = Symbol.QuantityToVolume(lot);
if (buy)
{
for (int i = 0; i < nr; i++)
ExecuteMarketOrder(TradeType.Buy, Symbol, volume);
}
if (sell)
{
for (int i = 0; i < nr; i++)
ExecuteMarketOrder(TradeType.Sell, Symbol, volume);
}
}
}
}
thanks its very usefull coding .. thanks your help for others. becuase i am not devolper ... thank you so much its working grate..
i build according to given new v2 . i m didn't change anything just bull algo file. if any one intrest i attached file. ohhhhhhhhhhhh sorry i can't attached file due to some issue.. pls mail me gayanasa@gmail.com
gayanasa
28 Jun 2019, 05:52
RE:
lucian said:
@gayanasa