Skip to content

Commit 07ded61

Browse files
authored
Fix currency formatting (#7723)
* Replace currency string formatting with Lean currency symbols. Also clean up orders tags from having redundant information. * Setting default order tag only after price currency is properly set * Minor fixes and new unit tests * Minor fixes
1 parent 0cd979f commit 07ded61

32 files changed

+228
-141
lines changed

Algorithm.CSharp/AddBetaIndicatorRegressionAlgorithm.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ public override void OnOrderEvent(OrderEvent orderEvent)
138138
{"Estimated Strategy Capacity", "$35000000.00"},
139139
{"Lowest Capacity Asset", "IBM R735QTJ8XC9X"},
140140
{"Portfolio Turnover", "1.51%"},
141-
{"OrderListHash", "e930f95771bc50dd2db1c353e054c4e7"}
141+
{"OrderListHash", "381bb9310f9dceb8a79a56849789bdab"}
142142
};
143143
}
144144
}

Algorithm.CSharp/BasicTemplateCryptoAlgorithm.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,7 @@ public override void OnEndOfAlgorithm()
237237
{"Estimated Strategy Capacity", "$0"},
238238
{"Lowest Capacity Asset", "BTCEUR 2XR"},
239239
{"Portfolio Turnover", "118.08%"},
240-
{"OrderListHash", "551b20736f4558a5af5c02b84451fb77"}
240+
{"OrderListHash", "77458586d24f1cd00623d63da8279be2"}
241241
};
242242
}
243243
}

Algorithm.CSharp/BybitCryptoRegressionAlgorithm.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ public override void OnEndOfAlgorithm()
166166
{"Estimated Strategy Capacity", "₮560000.00"},
167167
{"Lowest Capacity Asset", "BTCUSDT 2UZ"},
168168
{"Portfolio Turnover", "44.04%"},
169-
{"OrderListHash", "fb30d137fffe2bc4195d261f0f195b69"}
169+
{"OrderListHash", "b3a9eb7392ba1eb7eb0cc387f7382b6c"}
170170
};
171171
}
172172
}

Algorithm.CSharp/CancelOpenOrdersRegressionAlgorithm.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ public override void OnEndOfAlgorithm()
161161
{"Estimated Strategy Capacity", "$370000.00"},
162162
{"Lowest Capacity Asset", "ETHUSD 2XR"},
163163
{"Portfolio Turnover", "104.59%"},
164-
{"OrderListHash", "bd538acb61fa1fd91732212664c9bbed"}
164+
{"OrderListHash", "ec714d818fa30597e992d4c6e939e68c"}
165165
};
166166
}
167167
}

Algorithm.CSharp/ContinuousFutureLimitIfTouchedOrderRegressionAlgorithm.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ public override void OnEndOfAlgorithm()
114114
{"Estimated Strategy Capacity", "$2600000000.00"},
115115
{"Lowest Capacity Asset", "ES VMKLFZIH2MTD"},
116116
{"Portfolio Turnover", "16.49%"},
117-
{"OrderListHash", "a8b0528aa2c4c2b8f013a06104ddb1d0"}
117+
{"OrderListHash", "a83211606af7216647acfd9b5f6907a5"}
118118
};
119119
}
120120
}

Algorithm.CSharp/ExtendedMarketTradingRegressionAlgorithm.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ public bool InMarketHours()
136136
{"Estimated Strategy Capacity", "$14000000.00"},
137137
{"Lowest Capacity Asset", "SPY R735QTJ8XC9X"},
138138
{"Portfolio Turnover", "1.44%"},
139-
{"OrderListHash", "730d1d797bbe9449a6dc123990f5bd4b"}
139+
{"OrderListHash", "1ebbd6a077af944e04ee437a5219eef4"}
140140
};
141141
}
142142
}

Algorithm.CSharp/FutureStopMarketOrderOnExtendedHoursRegressionAlgorithm.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ public override void OnEndOfAlgorithm()
149149
{"Estimated Strategy Capacity", "$3400000.00"},
150150
{"Lowest Capacity Asset", "ES VMKLFZIH2MTD"},
151151
{"Portfolio Turnover", "138.95%"},
152-
{"OrderListHash", "c85997dd5b7d9acda46ac9d11dd1a039"}
152+
{"OrderListHash", "b26a8ad66a8dc5af768a22fbf9a80cec"}
153153
};
154154
}
155155
}

Algorithm.CSharp/LimitFillRegressionAlgorithm.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ public override void OnOrderEvent(OrderEvent orderEvent)
114114
{"Estimated Strategy Capacity", "$180000000.00"},
115115
{"Lowest Capacity Asset", "SPY R735QTJ8XC9X"},
116116
{"Portfolio Turnover", "9.86%"},
117-
{"OrderListHash", "14eaea4041585a9110df4b5861793f9e"}
117+
{"OrderListHash", "a5363ad9b8119f0e256a48efdc7acbb5"}
118118
};
119119
}
120120
}

Algorithm.CSharp/LimitIfTouchedRegressionAlgorithm.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,9 @@ public class LimitIfTouchedRegressionAlgorithm : QCAlgorithm, IRegressionAlgorit
3535
// We assert the following occur in FIFO order in OnOrderEvent
3636
private readonly Queue<string> _expectedEvents = new Queue<string>(new[]
3737
{
38-
"Time: 10/10/2013 13:31:00 OrderID: 72 EventID: 399 Symbol: SPY Status: Filled Quantity: -1 FillQuantity: -1 FillPrice: 144.6434 USD LimitPrice: 144.3551 TriggerPrice: 143.61 OrderFee: 1 USD",
39-
"Time: 10/10/2013 15:57:00 OrderID: 73 EventID: 156 Symbol: SPY Status: Filled Quantity: -1 FillQuantity: -1 FillPrice: 145.6636 USD LimitPrice: 145.6434 TriggerPrice: 144.89 OrderFee: 1 USD",
40-
"Time: 10/11/2013 15:37:00 OrderID: 74 EventID: 380 Symbol: SPY Status: Filled Quantity: -1 FillQuantity: -1 FillPrice: 146.7185 USD LimitPrice: 146.6723 TriggerPrice: 145.92 OrderFee: 1 USD" });
38+
"Time: 10/10/2013 13:31:00 OrderID: 72 EventID: 399 Symbol: SPY Status: Filled Quantity: -1 FillQuantity: -1 FillPrice: $144.6434 LimitPrice: $144.3551 TriggerPrice: $143.61 OrderFee: 1 USD",
39+
"Time: 10/10/2013 15:57:00 OrderID: 73 EventID: 156 Symbol: SPY Status: Filled Quantity: -1 FillQuantity: -1 FillPrice: $145.6636 LimitPrice: $145.6434 TriggerPrice: $144.89 OrderFee: 1 USD",
40+
"Time: 10/11/2013 15:37:00 OrderID: 74 EventID: 380 Symbol: SPY Status: Filled Quantity: -1 FillQuantity: -1 FillPrice: $146.7185 LimitPrice: $146.6723 TriggerPrice: $145.92 OrderFee: 1 USD" });
4141

4242
/// <summary>
4343
/// Initialise the data and resolution required, as well as the cash and start-end dates for your algorithm. All algorithms must initialized.
@@ -74,10 +74,10 @@ public override void OnData(Slice data)
7474
$"LIT - Quantity: {_negative * 10}");
7575
_request = Transactions.AddOrder(orderRequest);
7676
return;
77-
77+
7878
}
7979

80-
// Order updating if request exists
80+
// Order updating if request exists
8181
if (_request != null)
8282
{
8383
if (_request.Quantity == 1)
@@ -105,7 +105,7 @@ public override void OnOrderEvent(OrderEvent orderEvent)
105105

106106
if (orderEvent.ToString() != expected)
107107
{
108-
throw new Exception($"orderEvent {orderEvent.Id} differed from {expected}");
108+
throw new Exception($"orderEvent {orderEvent.Id} differed from {expected}. Actual {orderEvent}");
109109
}
110110
}
111111
}

Algorithm.CSharp/LimitOrdersAreFilledAfterHoursForFuturesRegressionAlgorithm.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ public override void OnOrderEvent(OrderEvent orderEvent)
149149
{"Estimated Strategy Capacity", "$39000000.00"},
150150
{"Lowest Capacity Asset", "ES VMKLFZIH2MTD"},
151151
{"Portfolio Turnover", "33.59%"},
152-
{"OrderListHash", "170df706887bac7764441b9368887a1d"}
152+
{"OrderListHash", "8b3baab1411a6db34780601bdd68ef9e"}
153153
};
154154
}
155155
}

0 commit comments

Comments
 (0)