Comments (4)
If you're retrieving the signal of the last candle, you should set the second parameter of the indexedcandle to candles.count()-1 instead of 1
from trady.
Thanks for the fast response I think the following test methods mislead me about the parameter to be set as "1" . But still "candles.count()-1" doesn't catch the "if (indexedCandle.IsMacdBullishCross(x, y, z) == true)" condition. I will be debugging If I find anything I will share but If you have any root cause analysis result please share.
Thank you.
[TestMethod]
public async Task TestIsBullish()
{
var candles = await ImportCandlesAsync();
var indexedCandle = new IndexedCandle(candles, 1);
var result = indexedCandle.IsBullish();
Assert.IsFalse(result);
}
[TestMethod]
public async Task TestIsBearish()
{
var candles = await ImportCandlesAsync();
var indexedCandle = new IndexedCandle(candles, 1);
var result = indexedCandle.IsBearish();
Assert.IsTrue(result);
}
from trady.
Hi again, I found the problematic part
public static bool IsTrue(this (AnTick, AnTick, AnTick) obj, Func<AnTick, AnTick, AnTick, bool> predicate) { Predicate<AnTick> isValid = t => t != null && t.Tick != null && t.Tick.HasValue; return isValid(obj.Item1) && isValid(obj.Item2) && isValid(obj.Item3) && predicate(obj.Item1, obj.Item2, obj.Item3); }
always returns false for the following calls
`public static bool IsMacdBullishCross(this IIndexedOhlcv ic, int emaPeriodCount1, int emaPeriodCount2, int demPeriodCount)
=> ic.Get(emaPeriodCount1, emaPeriodCount2, demPeriodCount).ComputeNeighbour(ic.Index)
.IsTrue((prev, current, _) => prev.Tick.IsNegative() && current.Tick.IsPositive());
`
public static bool IsEmaBullishCross(this IIndexedOhlcv ic, int periodCount1, int periodCount2) => ic.Get<ExponentialMovingAverageOscillator>(periodCount1, periodCount2).ComputeNeighbour(ic.Index) .IsTrue((prev, current, _) => prev.Tick.IsNegative() && current.Tick.IsPositive());
and for all similar calls isValid(obj.Item3) returns false.
from trady.
Related to #53, this issue is closed.
from trady.
Related Issues (20)
- Transforming Data issue HOT 1
- Not getting expected CCI values HOT 3
- update problem HOT 3
- Kst indicator
- commodity channe lindex incorrect value
- Minute to hour transformation: failure HOT 3
- Rule bug?
- Performance when computing single indexes on RSI with large datasets HOT 2
- How to correctly call and compute indicators HOT 1
- Library incompatible w/ newer versions of CsvHelper HOT 6
- Volume Profile Indicator HOT 1
- Takes Too Long To Get Data From Importer HOT 1
- Need Help With Custom Importer HOT 11
- Indicator on Indicator 'TInput TOutput not matched' HOT 1
- TransformToCandles<Daily> Return repeated days
- Trady for crypto - Node.js
- AccumulationDistributionLine<TInput,TOutput> constructor is protected and cannot be instanciated!
- Performance issues with 2000 candles & Backtesting
- Error occured using trade
- How to import trades
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from trady.