mirror of
https://github.com/mihakralj/QuanTAlib.git
synced 2026-08-18 18:48:05 +00:00
Refactor code formatting and improve consistency across various test files
- Removed unnecessary blank lines in multiple test files to enhance readability. - Ensured consistent spacing and formatting in the `Trima`, `Usf`, `Vidya`, `Wma`, and `Atr` test classes. - Updated comments for clarity and consistency in the `Atr` and `Adl` classes. - Adjusted project files for better structure and maintainability.
This commit is contained in:
+4
-4
@@ -36,7 +36,7 @@ public class MySmaIndicator : Indicator
|
||||
{
|
||||
// Get price from Quantower
|
||||
double price = ClosePrice;
|
||||
|
||||
|
||||
// Update QuanTAlib
|
||||
// Note: Quantower handles bar updates, so a check is performed to determine whether this is a new bar or an update
|
||||
bool isNew = args.Reason == UpdateReason.NewBar;
|
||||
@@ -73,10 +73,10 @@ protected override void OnBarUpdate()
|
||||
{
|
||||
// NinjaTrader calls OnBarUpdate for every tick (if Calculate = OnEachTick)
|
||||
// or once per bar (if Calculate = OnBarClose)
|
||||
|
||||
|
||||
bool isNew = IsFirstTickOfBar; // Logic depends on Calculate mode
|
||||
var result = _sma.Update(new TValue(Time[0], Close[0]), isNew);
|
||||
|
||||
|
||||
Value[0] = result.Value;
|
||||
}
|
||||
```
|
||||
@@ -104,7 +104,7 @@ public class MyAlgorithm : QCAlgorithm
|
||||
{
|
||||
var bar = data.Bars["SPY"];
|
||||
var result = _mySma.Update(new TValue(bar.EndTime, (double)bar.Close));
|
||||
|
||||
|
||||
if (_mySma.IsHot)
|
||||
{
|
||||
Plot("Indicators", "SMA", result.Value);
|
||||
|
||||
Reference in New Issue
Block a user