Skip to content

Commit

Permalink
Fixes EA31337/Strategy-Meta_MA_Cross#2. Fixed Wrong applied price for…
Browse files Browse the repository at this point in the history
… ValueStorage-based iPrice()
  • Loading branch information
nseam committed Mar 29, 2024
1 parent a47522b commit 70f8835
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion Storage/ValueStorage.price.h
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,14 @@ class PriceValueStorage : public HistoryValueStorage<double> {
return _low.Fetch(_shift);
case PRICE_CLOSE:
return _close.Fetch(_shift);
case PRICE_MEDIAN:
return (_high.Fetch(_shift) + _low.Fetch(_shift)) / 2;
case PRICE_TYPICAL:
return (_high.Fetch(_shift) + _low.Fetch(_shift) + _close.Fetch(_shift)) / 3;
case PRICE_WEIGHTED:
return (_high.Fetch(_shift) + _low.Fetch(_shift) + (2 * _close.Fetch(_shift))) / 4;
}
Alert("Wrong applied price for ValueStorage-based iPrice()!");
Alert("Wrong applied price for ValueStorage-based iPrice()! Got ", EnumToString(_ap));
DebugBreak();
return 0;
}
Expand Down

0 comments on commit 70f8835

Please sign in to comment.