![]() ![]() ![]() (* swapped + and - in these two lines, plug your own method here *)īuySignal = meanPrice - 2 standardDeviationPrice SellSignal = meanPrice + 2 standardDeviationPrice (* Mean of the second column of the data matrix *) StandardDeviationPrice = StandardDeviation]] HistoricalPrice = Missing,Ĭontinue] (* Shamefully inadequate error handling *) If[currentPrice = $Failed || historicalPrice = $Failed ||ĬurrentPrice = Missing || Some very very basic code to get you started: StartDate = DatePlus, ], $Failed] You need a construction to repeat the calculations for every NYSE member.Also, when current price is between your two signals the program provides conflicting advice. You might think of selling when prices are historically high, but you're doing it when they are above the historic low watermark. ![]() I don't think your buy and sell signals are very smart.Though it is allowed to start a variable with an uppercase letter you better avoid doing that in order to prevent using Mathematica's own keywords (which all start with an uppercase letter).You are also trying to average the dates and find their standard deviation. The data you receive from some of the calls include both prices and dates.a*b, a b, a 2, 2 a and 2a (without a space) are all correct multiplications. An asterisk for multiplication is unnecessary.You may suppress output using ' ' (which also acts to separate compound statements) ![]()
0 Comments
Leave a Reply. |