Sem categoria

How to Code a Trading Bot in Python – Beginners Guide





* O link do vídeo está no final desse post.

Descubra tudo sobre Robô IQ OPTION de AUTOMATIZAÇÃO de Lista de SINAIS
E conheça também sobre o Melhor Bot Para Opções Binárias 2022
Que tal um robo gratuito para IQ Option? Sistema Para IQ Option Grátis





In this video, we are going to code a python trading algorithm in the QuantConnect platform. Feel free to code along!

Check out QuantConnect:
(This is a referral link.)

Clone my algorithm here:

The best algorithmic trading platforms:

Follow me on:
Facebook:
Twitter:
Pinterest:

Vídeo

Gosta de dicas de futebol para investimento desportivo? Então visita agora mesmo Palpites Copa do Mundo e prepara-se para viver a emoção do maior campeonato do planeta.





37 Comentários

  1. import numpy as np

    class CalculatingSkyBlueKoala(QCAlgorithm):

    def Initialize(self):
    self.SetCash(100000)

    self.SetStartDate(2017,9,1)
    self.SetEndDate(2020,9,1)

    self.Symbol = self.AddEquity("SPY",Resolution.Daily).Symbol

    self.lookback = 20

    self.ceiling, self.floor = 30, 10

    self.initialStopRisk = 0.97
    self.trailingStopRisk = 0.9

    self. schedule.on(self.DareRules.Everyday(self.Symbol,Symbol),
    self.TimeRules.AfterMarketOpen(self.Symbol, 20),
    Action(self.EveryMarketOpen))

    def OnData(self, data):
    self.Plot("Data Chart", self.Symbol, self.Securities[self.symbol].close)

    def EveryMarketOpen(self):
    close = self.History(self.Symbol, 31, Resolution.Daily)["close"]
    todayvol = np.std(close[1:31])
    yesterdayvol = np.std(close[0.30])
    deltavol = (todayvol – yesterdayvol) / todayvol
    self.lookback = (self.lookback * (1 + deltavol))

    if self.lookback > self.ceiling:
    self.lookback = self.ceiling
    elif self.lookback < self.floor:
    self.lookback = self.floor

    self.high = self.History(self.Symbol, self.lookback, Resolution.Daily)["High"]

    if not self.Securties[self.symbol].Invested and
    self.Securities[self.Symbol].Close >= max(self.high[:-1]):
    self.SetHoldings(self.Symbol, 1)
    self.breakout1v1 = max(self.high[:-1])
    self.highestPrice = self.breakout1v1

    if self.Securities[self.Symbol].Invested:
    if not self.Transactions.GetOpenOrders(self.Symbol):
    self.stopMarketTicket = self.StopMarketOrder(self.symbol,
    -self.Portfolio[self.symbol].Quantity,
    self.initialStopRisk * self.breakout1v1)

    if self.Securities[self.Symbol].Close > self.highestPrice and
    self.initialStopRisk * self.breakout1v1 < self.Securities[self.symbol].Close * self.trailingStopRisk
    self.highestPrice = self.Securities[self.symbol].Close
    updateFields = updateOrderFields()
    updateFields.StopPrice = self.securities[self.symbol].close * self.trailingStopRisk
    self.stopMarketTicket.Update(updateFields)

    self.Debug(updateFields.StopPrice)

    self.Plot("Data Chart", "Stop Price", self.stopMarketTicket.Get(OrderField.StopPrice))

    someone find the bug for me because it is bugging me

  2. me who has no coding experience besides dropping out of video game design class in unity interestttingggg

  3. I still have 1 error and I can't figure out what I think started around line 23 in your video. other than that I love this video and study it religiously.

  4. it doesn't want to backtest keeps showing error in line 22 EveryMarketOpen someone please help

  5. hi, im writing this after using your tutorial to create the bot (wich i found really helpful and well-written). After this, what can i do to make it operate on my Binance account? Did you create a tutorial about the steps after creating the bot?

  6. how to add public indicators to this code line if we use our strategy of bot. and we want to send it to api of our account? for ex. when the line turns a colour? or below or upper color etc.

  7. Please can anybody explain what is needed to do to launch a backtest? Building works fine, the whole code ben checked 10 times, just when I click on the backtest button then nothing happens, the button does not even seem to be responsive. Thanks in advance for any help…

  8. I don't get it, I copy paste your code and can't get it to fuckin backtest this is fkin frustrating gonna explode my fkin computer

  9. This who tutorial is just an ad for this service. So you have to rely on their reputation and make sure you trust them on prices they provide you via API. It’s a black box and you don’t know what is going on there.