Record the P&L value, print the P&L value and plot the return curve based on the P&L value.
LogProfit(profit) LogProfit(profit, …args)
The parameter profit
is the revenue data, which is given by the design algorithm and calculation in the strategy.
profit
true
number
Extended parameter to output incidental information to the revenue log, arg
parameters can be passed more than one.
arg
false
string, number, bool, object, array, any type supported by the system such as null.
function main() {
// Print 30 points on the earnings chart
for(var i = 0; i < 30; i++) {
LogProfit(i, '&')
Sleep(500)
}
}
def main():
for i in range(30):
LogProfit(i, '&')
Sleep(500)
void main() {
for(int i = 0; i < 30; i++) {
LogProfit(i, '&');
Sleep(500);
}
}
The LogProfit
function, if it ends with the character &
, draws the revenue chart only and does not print the revenue log. For example:
{@fun/Log/LogProfitReset LogProfitReset}
Log LogProfitReset