Pivots Points are significant levels chartists can use to determine directional movement and potential support/resistance levels. Pivot Points use the prior period's high, low, and close to estimate future support and resistance levels.
Essentially It is as you understood.
Re the formulas I recommend you to try to replicate their calculation in AmiBroker. It is not that difficult.
Moreover, there are a lot of code samples around and in particular, some good ones in the Member's Zone AFL library to learn from!
You can't really code Price Action into AFL because there are so many aspects to it. You would end up trying to code a thousand rules into AFL, and even then, Price Action requires a certain amount of experience or "feel". After a thousand hours of intraday screen time you will develop a feel for price action.
You could start by reading Understanding Price Action by Bob Volman, which is sort of a classic, but you really need to develop experience. Reading other TA books and learning to recognise price patterns is a start. But you never stop learning.
The problem with a lot of people (and especially beginners) is that they don't want to put in the hours/years to learn their craft.
Everyone ends up developing their own style that they become comfortable with anyway. I use PA but you might detest it.
"You can't put an old head on young shoulders".
You need to start with SOMETHING. Anything. And stick with that until it no longer serves you. You started asking about Pivots and then immediately switched to PA when I mentioned it. If I mention something else, you'll go off chasing that!
You really will learn a LOT if you just start with the "Secrets Of A Pivot Boss" book. Because Frank has so much experience besides pivots and he doesn't try to hide it from you.
@santy: Show us how you are calculating your pivot points now (for Monthly, Weekly, Daily, Hourly, Minute) and then tell us what time frame you are having difficulty calculating them for.... Then we can probably help...
As always, the best way to get help here is to show us your work, and where you are having an issue.
My guess is that if you build some pivots yourself, you will be able to make them do/be what you want. It starts with you trying out a few different ideas and seeing which works best for you.
This is a bit of a esoteric or psychological thing, but you have to know what works for you. You may find that a pivot based on the last 5 minute bar works for you. Another trader may only work with a 30 minute pivot for trading the 5 minute chart. You need to experiment and see what works for you. Then you can code it.
Taking someone else's code/trading style and trying to make it work for you does not always work. In my limited experience, unless it is 100% mechanical, you will personalize it in some way, and then, it is not the same system.
So your code looks to be building a standard pivot. Have you tried overlaying a 5 minute as well to see what that does? How about adding a Range to the pivot above and below to see potential Support / Resistance.
Lots of ways to customize. Try some out. Experiment (not with real money). See if you can back test the ideas.
I am trading the 5 & 10 EMA CROSSOVER.
I want to add the applystop code or normal code for the below 2
conditions to square off the trades already entered by buy or short
strategy execution. we should come out only if
1.loss is 10 points or more
2.for every 10 points profit, stopploss should be revised to 5 more
points and so on till the stoploss is hit.
Please guide me for the above.
I tried the applystop code but did not get success.