Topics
Replies
PanagiotisCharalampous
30 Apr 2019, 14:18
Hi reza h,
Can you define "flat"? Do you want all the values of the indicator to be flat? and how long is "a while"?
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
30 Apr 2019, 14:16
Hi Symposium,
You need to provide more information on this. Where does this happen? On backesting? How can we reproduce? What is the volume? Do you get any error messages in the log?
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
30 Apr 2019, 12:53
Hi JohnK,
Please share with us the indicator code as well.
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
30 Apr 2019, 12:49
Hi FireMyst,
It is planned to be fixed in 3.5.
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
30 Apr 2019, 12:45
Hi lec0456,
You can check the Poistions collection but I can assume you already do that. Donald is right, sharing the cBot code might help understanding the causes and giving more appropriate guidance.
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
30 Apr 2019, 12:43
Hi fxwisdom1@gmail.com,
It is 100 characters.
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
30 Apr 2019, 12:42
Hi Sasha,
You can use RemoveObject() function and identify these objects by a string.
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
30 Apr 2019, 12:34
Hi John,
You need to make sure you are using corresponing indices. See below the correct way to implement it
using System; using cAlgo.API; using cAlgo.API.Indicators; using cAlgo.API.Internals; namespace cAlgo.Indicators { [Indicator("P_C_Source", IsOverlay = false, ScalePrecision = 5)] public class P_C_Source : Indicator { [Output("P_C_Source", LineColor = "Red", LineStyle = LineStyle.Solid)] public IndicatorDataSeries Result { get; set; } [Parameter()] public string SymbolCode { get; set; } private MarketSeries PC_Symbol_series; private Symbol PC_Symbol; protected override void Initialize() { PC_Symbol = MarketData.GetSymbol(SymbolCode); PC_Symbol_series = MarketData.GetSeries(PC_Symbol, TimeFrame); } public override void Calculate(int index) { Result[index] = PC_Symbol_series.Close[PC_Symbol_series.OpenTime.GetIndexByTime(MarketSeries.OpenTime[index])]; } } }
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
30 Apr 2019, 12:28
Hi dominhtri1995,
There is no such feature at the moment.
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
30 Apr 2019, 12:27
Hi all,
Please send troubleshooting information whenever you encounter such a behavior. Press Ctrl+Alt+Shift+T. paste the link your comment in the text box and press submit.
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
25 Apr 2019, 12:38
Hi FireMyst,
Probably this is what is happening but I cannot confirm if I do not execute this myself :)
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
25 Apr 2019, 11:04
Hi jonkey,
Try this approach and let me know if it works for you
var source = MarketData.GetSeries(TimeFrame.Daily); sma = Indicators.SimpleMovingAverage(source.Close, smaPeriod);
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
25 Apr 2019, 10:09
Hi Sasha,
I haven't tried it but should work for m1 bars.
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
25 Apr 2019, 09:48
Hi mariusgunnerud,
Try this
PendingOrders.Count(x => x.SymbolCode == Symbol.Name);
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
25 Apr 2019, 09:44
Hi tgjobscv,
No this is not possible and doesn't make much sense e.g. if you set a Sell Limit at 1.2 and it is triggered when the price crosses below 1.2 then the order will not be filled since the price will be below the limit. Why do you need this?
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
25 Apr 2019, 09:34
Hi DelTrader,
I do not see anything wrong in this code. Can you share the complete cBot code? Make sure you are setting the labels correctly.
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
24 Apr 2019, 17:23
Hi dominhtri1995,
No the indicator will not run on a previous version.However soon all brokers will be updated to 3.5.
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
24 Apr 2019, 16:45
Hi andi21,
Please note that this applies only for built in SL and TP. If you have a custom made logic, like below, then your execution will not be accurate
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 { [Parameter(DefaultValue = 0.0)] public double Parameter { get; set; } protected override void OnStart() { ExecuteMarketOrder(TradeType.Buy, Symbol.Name, 1000); } protected override void OnTick() { if (Positions.Count > 0 && Positions[0].Pips < -2) Positions[0].Close(); } protected override void OnStop() { // Put your deinitialization logic here } } }
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
24 Apr 2019, 16:27
( Updated at: 21 Dec 2023, 09:21 )
Hi andi21,
The cBot will honor the SL and TP prices regardless the fact that only m1 bar data is used. See the example below
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 { [Parameter(DefaultValue = 0.0)] public double Parameter { get; set; } protected override void OnStart() { ExecuteMarketOrder(TradeType.Buy, Symbol.Name, 1000, "", 2, 100); } protected override void OnTick() { Print("Test"); } protected override void OnStop() { // Put your deinitialization logic here } } }
and see where the SL is triggered
The difference with the tick data execution is that the OnTick() function is called only when the bar changes (hence the print statement in OnTick() for demonstration). So if you have logic in OnTick() method, backtesting on bars is not recommended.
Best Regards,
Panagiots
@PanagiotisCharalampous
PanagiotisCharalampous
30 Apr 2019, 14:20
Open API Error Codes have been added here
@PanagiotisCharalampous