Reset trade ok if above bollinger middle
Forums › ProRealTime English forum › ProOrder support › Reset trade ok if above bollinger middle
- This topic has 8 replies, 3 voices, and was last updated 6 years ago by
robertogozzi.
-
-
09/15/2019 at 3:22 PM #107590
Hey! I need help with a code.
For example.
Buy if close is below bollinger low and the system stopped me out -20P.
Now I do not want it to take more trades before it has reached bollinger middle first.
Then it can start looking for a trade again if close is below bollingerband low.
For example
OK = 1
OK = 0
If c1 and Ok = 1 then
buy 1contract at market.
09/15/2019 at 4:49 PM #107607This will reenable trading after you had previously disabled it.
Example with a 20-period BB:
123If low <= Average[20,0](close) ThenOk = 1Endif09/16/2019 at 5:58 AM #10764609/16/2019 at 7:45 AM #107655So you don’t need to reset OK if above Bollinger middle, but also to clear it after a trade?
Please post the code you have already written.
09/16/2019 at 2:08 PM #107720So in the first pic close is never above the boll middle after the first trade is done, so that actually dosnt make sense.
You could use something like “highest[10](close) > highest[10](average[20](close))”
someone please correct me if im wrong, but that would mean that for the past 10 bars (or whatever number you would use), price must have been above the moving average 20 (aka bollinger middle) But that would also mean that the “move” so to speak has to happen within XX bars, probably not exactly what you wanted but its at least a step in the right direction..
09/16/2019 at 9:28 PM #107782If long and stopped then Ok should be 0. Then the system cannot do any trade because OK=0.
To reset OK to 1 again, the price must be up to bollinger middle.
Then it is allowed to take a trade again. because OK=1.
The idea is to avoid buying and buying and the price continues to fall.
I want it to be normal conditions again before the system takes on a new trade.
Hope it helps
/Christian
I think that everything is back to normal when the price went up to bollinger middle after a fall.
09/16/2019 at 9:34 PM #107786Yes. but not just after a certain number. Price must be above bollinge middle
So in the first pic close is never above the boll middle after the first trade is done, so that actually dosnt make sense.
You could use something like “highest[10](close) > highest[10](average[20](close))”
someone please correct me if im wrong, but that would mean that for the past 10 bars (or whatever number you would use), price must have been above the moving average 20 (aka bollinger middle) But that would also mean that the “move” so to speak has to happen within XX bars, probably not exactly what you wanted but its at least a step in the right direction..
09/16/2019 at 9:39 PM #10778709/16/2019 at 11:13 PM #107792Yes. but not just after a certain number. Price must be above bollinge middle
So in the first pic close is never above the boll middle after the first trade is done, so that actually dosnt make sense.
You could use something like “highest[10](close) > highest[10](average[20](close))”
someone please correct me if im wrong, but that would mean that for the past 10 bars (or whatever number you would use), price must have been above the moving average 20 (aka bollinger middle) But that would also mean that the “move” so to speak has to happen within XX bars, probably not exactly what you wanted but its at least a step in the right direction..
No, what you want to achieve needs to be written, to just check that:
1summation[10](close) > highest[10](average[20](close)) = 10to check that ALL last 10 bars CLOSE has always been > highest[10](average[20](close)).
-
AuthorPosts
Find exclusive trading pro-tools on