1
$\begingroup$

Is it possible to use the FinancialData such as the PSAR indicator on imported CSV file ?

$\endgroup$
  • $\begingroup$ Akcmok, welcome to mma.se. Our standard welcome message: 1) As you receive help, try to give it too, by answering questions in your area of expertise. 2) If you haven't already done so please Take the [tour! ](mathematica.stackexchange.com/tour) ... $\endgroup$ – kglr Jul 6 '18 at 7:02
  • $\begingroup$ ... 3) When you see good questions and answers, vote them up by clicking the gray triangles, because the credibility of the system is based on the reputation gained by users sharing their knowledge. Also, please remember to accept the answer, if any, that solves your problem, by clicking the checkmark sign! $\endgroup$ – kglr Jul 6 '18 at 7:02
2
$\begingroup$
  1. You can use your imported data as input to TradingChart and InteractiveTradingChart as long as its structure conforms to the pattern {datelist, {open, high, low, close, volume}}:

dates = DateRange[{2010, 1, 1}, {2010, 4, 30}];
ohlc = Sort /@ RandomReal[100, {Length@dates, 4}];
ohlc = ohlc[[All, {3, 4, 1, 2}]];
vol = RandomInteger[100, Length@dates];
data = Transpose[{dates, Join[ohlc, List /@ vol, 2]}];

tc = TradingChart[data, {"ParabolicStopAndReversal"}, 
  Appearance -> "Line", ImageSize -> 400]

enter image description here

  1. You can use a built-in FinancialIndicator function, e.g. "ParabolicStopAndReversal", outside TradingChart or InteractiveTradingChart to create a list that you can use with, say, DateListPlot:

ParabolicStopAndReversal

enter image description here

ClearAll[psar]
psar[a_: .02, b_: .2] := FinancialIndicator["ParabolicStopAndReversal", a, b];
dlp = DateListPlot[{Transpose[{data[[All, 1]], data[[All, 2, 4]]}], 
    Transpose[{data[[All, 1]], psar[][data]}] }, 
   Joined -> {True, False}, ImageSize -> 400, ImagePadding -> Scaled[.03]];

enter image description here

$\endgroup$
  • $\begingroup$ kglr, this is of great help $\endgroup$ – Akcmok Jul 6 '18 at 6:37
  • $\begingroup$ @Akcmok, glad it was useful. Welcome to mma.se. $\endgroup$ – kglr Jul 6 '18 at 7:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.