drilonhametaj

Info
Username: | drilonhametaj |
Name: | drilonhametaj |
Member since: | 22 Dec 2022 |
About
None
Signature
None
Last Forum Posts
@Bring in other time series to a bot: 22 Dec 2022, 19:27
Hi, i had the same problem but i found a solution using
MarketData.GetBars(TimeFrame.Daily)
Then you can use this bars as Source for your indicators, i will put here an example for using it:
protected override void OnStart()
{
// Put your initialization logic here
timeFrameDaily = MarketData.GetBars(TimeFrame.Daily);
timeFrameWeekly = MarketData.GetBars(TimeFrame.Weekly);
timeFrameMonthly = MarketData.GetBars(TimeFrame.Monthly);
}
protected override void OnTick()
{
// Put your core logic here
emaDaily = Indicators.ExponentialMovingAverage(timeFrameDaily.ClosePrices, fastPeriod);
emaWeekly= Indicators.ExponentialMovingAverage(timeFrameWeekly.ClosePrices, midPeriod);
emaMonthly = Indicators.ExponentialMovingAverage(timeFrameMonthly.ClosePrices, slowPeriod);
In this example i use 3 EMA with different timeframe, in backtesting this will kill the performance, need a lot of time for backtesting
Notification Publishing copyrighted material is strictly prohibited. If you believe there is copyrighted material in this section you may use the Copyright Infringement Notification form to submit a claim.
No uploaded.
Warning! Executing cBots downloaded from this section may result in loss of funds. Use them at your own risk.