
Topics
Replies
PanagiotisCharalampous
05 Aug 2024, 06:02
RE: RE: RE: RE: Get symbol all time high/low
ncel01 said:
PanagiotisCharalampous said:
ncel01 said:
PanagiotisCharalampous said:
Hi there,
You would need to get all the bars from the server and check the high/low. Try M1 to save time.
Best regards,
Panagiotis
Hi Panagiotis,
How can that be achieved programmatically?
Symbol.AllTimeHigh would be straight forward but I believe there is no such property available. So, what can be a work around here?
Thank you.
Hi ncel01,
You can load all the bars by using Bars.LoadMoreHistory(). Then you can use Bars.HighPrices.Maximum(Bars.Count) and Bars.LowPrices.Minimum(Bars.Count) to get the respective high and low.
Best regards,
Panagiotis
Panagiotis,
Thanks.Bars.LoadMoreHistory() does not seem to change anything, no matter the time frame.
On the other hand, it looks like max/min historical prices are only caught when using monthly bars :var bars = MarketData.GetBars(TimeFrame.Monthly);var maxHistorical = bars.HighPrices.Maximum(bars.Count);var minHistorical = bars.LowPrices.Minimum(bars.Count));
Hi there,
Note that Bars.LoadMoreHistory() currently works only in real time execution and you need to call it until it returns 0, so that all bars have been loaded.
Best regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
05 Aug 2024, 06:01
Hi there,
They just need to open the link in their browser and they will be able to follow your strategy.
Best regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
05 Aug 2024, 05:59
Hi there,
If the indicator does not take any parameters, then you cannot just pass a parameter and expect it to work. If you want to pass a timeframe parameter then you need to reprogram HSNind to accept a parameter and perform the relevant calculation.
Best regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
05 Aug 2024, 05:54
Hi there,
You can request all open positions using Request for Positions. The response will be a Position Report with the information you need.
Best regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
05 Aug 2024, 05:50
Hi there,
See an example below
using System;
using cAlgo.API;
using cAlgo.API.Collections;
using cAlgo.API.Indicators;
using cAlgo.API.Internals;
namespace cAlgo.Robots
{
[Robot(AccessRights = AccessRights.None, AddIndicators = true)]
public class StopLoss : Robot
{
protected override void OnStart()
{
Positions.Closed += PositionsOnClosed;
}
private void PositionsOnClosed(PositionClosedEventArgs args)
{
if(args.Reason == PositionCloseReason.StopLoss)
{
Print("Stop loss triggered for position " + args.Position.Id);
}
}
}
}
Best regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
05 Aug 2024, 05:46
Hi there,
This tool is only available in cTrader Web at the moment.
Best regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
04 Aug 2024, 06:57
Hi Viktor,
cTrader just shows the signals received by TradingCentral. If singals are missing, it means TradingCentral does not provide any for the specific symbol/timeframe.
Best regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
04 Aug 2024, 06:54
Hi there,
When an application is in the background, then after some time the connection is dropped. So when brought back to the foreground, the connection needs to be reestablished.
Best regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
04 Aug 2024, 06:50
Hi there,
This is not in our immediate plans at the moment but it is something you can achieve yourself. You can optimize your strategy for a period in the past and leave out some data e.g. three months, for walk forward testing. Then, you can test these results and see how your strategy performs in out of sample data.
Best regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
04 Aug 2024, 06:42
RE: RE: RE: RE: Problem BOT does not open operation in backtest
emafondex69 said:
Thank you sir If I have other problems can I contact you here?
Yes of course, create a new thread for each issue you might have
@PanagiotisCharalampous
PanagiotisCharalampous
04 Aug 2024, 06:36
Hi there,
Please post your suggestions in the relevant topic below
https://ctrader.com/forum/suggestions/
Best regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
04 Aug 2024, 06:34
RE: RE: Get symbol all time high/low
ncel01 said:
PanagiotisCharalampous said:
Hi there,
You would need to get all the bars from the server and check the high/low. Try M1 to save time.
Best regards,
Panagiotis
Hi Panagiotis,
How can that be achieved programmatically?
Symbol.AllTimeHigh would be straight forward but I believe there is no such property available. So, what can be a work around here?
Thank you.
Hi ncel01,
You can load all the bars by using Bars.LoadMoreHistory(). Then you can use Bars.HighPrices.Maximum(Bars.Count) and Bars.LowPrices.Minimum(Bars.Count) to get the respective high and low.
Best regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
02 Aug 2024, 08:58
Hi there,
You would need to get all the bars from the server and check the high/low. Try M1 to save time.
Best regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
02 Aug 2024, 08:45
Hi there,
- How do I find the reason for rejection e.g not enough fund?
- How do I find the Order cancelled reason?
There is the ErrorCode filed with some textual explanation.
- How do I find if it's closed by Take Profit, closed by Stop Loss or any other reason like not enough margin?
For SL/TP check theProtoOAOrder. ProtoOAOrderType. For stop outs check ProtoOAOrder.isStopOut
I hope this helps.
Best regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
02 Aug 2024, 05:05
Hi there,
You should talk to the programmer regarding this matter.
Best regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
02 Aug 2024, 05:04
RE: RE: how to log a string into journal so that it saves on journal files?
kyosuke said:
PanagiotisCharalampous said:
Hi there,
If you are referring to the log, just use the Print("Write any string here") method.
Best regards,
Panagiotis
Correct me if I'm wrong: Print("") method ends up into “Algo” tab while I'm asking if is possibile to write in the “Journal” tab. Differences are:
- journal tab's logs is piled up by month while algo's ones are piled up by bot/indicator activation
- journal file path is always “C:\Users\username\Documents\cTrader\Journals\Spotware\Journal-YYYY-MM.txt” while algo file path is always unique per bot/indicator activation “C:\Users\username\Documents\cAlgo\Data\cBots\myBot\7c36a52f-2ab9-41db-a2c7-a5a2bfdb8c76\RealTime\log.txt” as I see a lot of UUIDs in the “myBot” folder
If there's no method to write into Journal logs, I'll obviusly go with the Algo logs…
You can't write in the Journal tab
@PanagiotisCharalampous
PanagiotisCharalampous
01 Aug 2024, 12:20
RE: THE REPLAY BUTTON IS NOT MORE IN MY CTRADER
ngngnice said:
hi!
since i am using cTrader; i really appreciate!
but i will like to understand why the replay button disappear in my cTrader. how can i get it back please?
thanks
Hi there,
What do you mean when you say it disappeared? Can you share screenshots?
Best regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
01 Aug 2024, 12:18
Hi there,
What you have highlighted on the strategy's page is not the strategy's position but the strategy's deals. It seems that the strategy provider has these positions permanently open.
Best regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
01 Aug 2024, 12:16
Hi there,
If you are referring to the log, just use the Print("Write any string here") method.
Best regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
05 Aug 2024, 06:04
Hi there,
Shariah compliant is an option that the brokers offer. You should consult with your broker if they offer shariah compliant accounts or not and what are their exact settings.
Best regards,
Panagiotis
@PanagiotisCharalampous