hi , everyone . how can i make a bot which works on according to this logic
- when it will buy any crypto coin it should check if the previous low of a candle and the current price of candle is same ( 1min interval bar)
- bot should buy as soon as the second candle hits the same low price as of first low
- bot should sell when the price hits the previous high
- if the price drops after buying , then the coin should be sold after new candle's high and should be bought when the price is low as before.
thank you for reading , hope u get my msg and what i want to do😊
Blackpanther
Vladimir hi , can u spare some time for my question , it would be really helpful 😊
Blackpanther
Vladimir hi , can u help me ?
Vladimir
Blackpanther
Here is my attempt to implement my understanding of your algorithm on hourly data.
Blackpanther
Vladimir hi I really liked what u did, but there are somethings missing
u know there is a pattern in this coin it falls and gets up can u make a bot according , above things depict it's move. Again Thanks for helping😊
Varad Kabade
Hi Blackpanther,
To implement the above strategy, we recommend using Rolling Window to store the slices we receive in OnData event handler.
We have created an example algorithm where we have implemented the buying logic to get you started.Refer to the attached backtest.
Best,
Varad Kabade
Vladimir
Blackpanther, Varad Kabade
Here is my, more pythonic, way to implement the rolling window in the original algorithm.
Blackpanther
Vladimir maybe this picture will tell u what I want
Then a breakout occurs.
I hope u understood , 😊
Blackpanther
Vladimir Hi , just wanted to make sure that if u understood what I meant . Hope u reply soon 😊
Vladimir
Blackpanther
Here is another algorithm with my attempts to solve most of your requests.
When the breakout low and current price the same: "buy"
if (C[0] == L[1] < L[2]): self.signal = 1
When the breakout high and current price the same: "sell"
elif (C[0] == H[1] > H[2]): self.signal = -1
The one bar check should only occur when there is a breakout
else: self.signal = 0
If you are satisfied with my answer, please accept it and don't forget to like it
Blackpanther
Vladimir Hi , why isn't this code working with “USDCUSDT” . Can u please look into the code
Vladimir
Blackpanther
Try QuantConnect Data Explorer to check symbol availability.
If you are satisfied with my answer, please accept it and don't forget to like it.
Blackpanther
Vladimir Yes , it is available in Binance Crypto Price Data .
Vladimir
Blackpanther
Here is one for USDCUSDT.
If you are satisfied with my answer, please accept it and don't forget to like it.
Blackpanther
Vladimir hi , why are these error occurring ?
Why most of the quantities are not getting sold at the right time?
The algorithm works good , if these two problems are solved we are good to go.😊
how to solve this error , can u tell me ?
Vladimir
Blackpanther
Is there anything wrong with the code I posted here?
Blackpanther
Vladimir
Yes there is one problem
problem with this code :- Reason: USDCUSDT: The security does not have an accurate price as it has not yet received a bar of data. Before placing a trade (or using SetHoldings) warm up your algorithm with SetWarmup, or use slice.Contains(symbol) to confirm the Slice object has price before using the data. Data does not necessarily all arrive at the same time so your algorithm should confirm the data is ready before using it. In live trading this can mean you do not have an active subscription to the asset class you're trying to trade. If using custom data make sure you've set the 'Value' property. Returning null.
and also the original problems which I had posted in previous comment here
😊
Vladimir
Blackpanther
Try this with resampled data.
Blackpanther
Hi Vladimir I tried ur code and it was working great until this happened
It stared buying at the highest and selling at the lowest . I hope u can provide me with some answers.😊
and one more thing when I changed the BAR to 1 , the trades increased and became 1920 instead of 26 when the BAR was 60. Can u explain me why this affected the volumes of trade ?
Vladimir
Blackpanther
Why did you change the parameters of the code that worked great for you.?
Blackpanther
Vladimir
because my parameter traded 1920 trades whereas your parameter traded 26 times only but that is not the problem the real problem is that the high and low are getting interchanged after some time. If you think that 60 is best for me, I will change it to 60.
Blackpanther
The material on this website is provided for informational purposes only and does not constitute an offer to sell, a solicitation to buy, or a recommendation or endorsement for any security or strategy, nor does it constitute an offer to provide investment advisory services by QuantConnect. In addition, the material offers no opinion with respect to the suitability of any security or specific investment. QuantConnect makes no guarantees as to the accuracy or completeness of the views expressed in the website. The views are subject to change, and may have become unreliable for various reasons, including changes in market conditions or economic circumstances. All investments involve risk, including loss of principal. You should consult with an investment professional before making any investment decisions.
To unlock posting to the community forums please complete at least 30% of Boot Camp.
You can continue your Boot Camp training progress from the terminal. We hope to see you in the community soon!