Important questions on cBots - Thread
Important questions on cBots - Thread
24 Feb 2021, 14:04
Hi guys
I need working insight on following issues:
1. How to show/tell the system in the code: market being over a particular Moving Average? Like, price/overall market has crossed over a MA at some point and it is still there.
This is useful for entering short when market is below a MA, and buy only when over the MA. What methods can be used?
2. When I tell the system to buy only if price is over a MA, it keeps opening buy positions repeatedly (after previous position is closed) as long as the price is still over that MA :) But I need one entry, only first, cause keeping buying multiple positions is risky. How to fix this?
prosteel1
24 Feb 2021, 17:03 ( Updated at: 21 Dec 2023, 09:22 )
RE:
tekASH said:
Few issues there, lets address the constant opening of buys first: I wrap my trading code in several conditions: Here is my on trade code that allows me to check if I have a current order or something. I have about 6 levels of these checks which all work together to prevent what you mentioned. It takes about 2 years to work out what is required.
The below prevents opening new orders when orders are already placed on the symbol.
For your specific question where you want to only trade once when the price is above the MA, I would create a variable to record a metric and prevent trading within a range of that metric. I see this too and is also something I am trying to fix.
I have had success with this by using the Count of the chart, but have also fount that a chart count might be able to be tried more than once if the entry is different from the first entry, but still testing that tbh.
@prosteel1