AR
Opening transaction when candle closed
05 Feb 2019, 17:32
Hi all! I wanna do a very simple think. I want execute transaction when one candle close and open a new candle. How i can do this?

PanagiotisCharalampous
05 Feb 2019, 17:40
Hi aricesar,
Thank you for posting in our forum. You can use the OnBar() function. See below an example
using System; using System.Linq; using cAlgo.API; using cAlgo.API.Indicators; using cAlgo.API.Internals; using cAlgo.Indicators; namespace cAlgo.Robots { [Robot(TimeZone = TimeZones.UTC, AccessRights = AccessRights.None)] public class NewcBot : Robot { protected override void OnStart() { // Put your initialization logic here } protected override void OnBar() { ExecuteMarketOrder(TradeType.Buy, Symbol, 1000); } protected override void OnStop() { // Put your deinitialization logic here } } }Best Regards,
Panagiotis
@PanagiotisCharalampous