While trying to figure out how to make the STDEV function use an exponential moving average instead of simple moving average , I discovered the builtin function doesn't really use either. Check it out, it's amazing how different the two-pass algorithm is from the builtin! Eventually I reverse-engineered and discovered that STDEV uses the Naiive algorithm and...
a small tutorial to explain how to work with orders, comments in the script.
In this second tutorial we build upon the previous tutorial. We add color shading for each different day and highlight Wednesday. The idea here is to manually count if on Wednesdays close is bigger then open. Hope it helps. Feel free to comment. MartinMystere
If you are just like me and cant just get your head around pine script, I have created this simple code so you get the main concept. Unfortunately there are no good step by step tutorials out there teaching scripting. Hope this helps. Comments are welcome. MatinMystere
type: pine series basic example time required: 10 minutes level: medium (need to know the "array" data variable as a generic programming concept, basic Pine syntax) tl;dr how variables and series work in Pine Pine is an array/vector language. That's something that twists how it behaves, and how we have to think about it. A lot of misunderstandings come from...
This simple strat fires up on green bars, down on red bars. cannot get any simpler. So, it's a good example to check how returns are calculated. First, the internal firing mechanism for the strategy.entry function is something hardcore. As result, the entry points can be confusing, and seem to appear in a wrong bar (as the 2nd and 3rd signals are good examples),...