Simple IB_INSYNC (Interactive Brokers) strategy template in notebook
Budget: $30 – $250 CAD
I am looking for a freelancer to create a simple python IB_INSYNC strategy using 1min data that can be run in jup notebook.
Rules:
If the first candle of the day closes above vwap, then buy.
If the first candle of the day closes below vwap, then sell.
(So the strategy is always either short or long from minute 2 of the day).
As the day progresses
If price crosses vwap from below, then close the pre existing short and initiate a long
If price crosses vwap from above, then close the pre existing long and initiate a short
Exit all positions at 15:58 oclock.
So basically the strategy just trades the crossover between price and vwap.
I also need to add several features to it.
For profit taking:
-if price rose by X% from the entry, add a stop loss = entry price
-if price rose by Y% (Y is bigger than X) from the entry, then cancel the previous stop loss, and instead add a trailing stop that trails by half of the distance traveled.
Example for X=5% and Y=15%:
Strategy is long at $100, once price rose by 5% to $105, a stop loss is added at $100, once price rose by 15% from the entry to $115, stop loss is cancelled and trailing stop is added. Trail amount is the half the distance that the price moved, so the move was $15, 15/2 = 7.5. Trailing stop at: $115 minus $7.5 = 107.5$.
Also, I want to be able to set limits for the amount by which price crosses vwap.
For example, lets say we had a big move and price crossed vwap from below and closed 20% away from vwap. Thats is a very extereme and rare event and I want to ignore them (ignore meaning that startegy wont trade on those signals). So ideally I want the strategy to trade only when the abs(amount by which price crosse vwap) is <= W%. W is a variable that can be altered.
Finally, an optional parameter that can be either turned on or off:
if OFF, then strategy trades the entire day
if ON, then strategy does not enter new positions between 12:30:00 and 13:30:00 (again i want to be able to modify the times)
Why so many additional features in the strategy?
I need a template that has a bunch different features implemented that I can use and copy paste from as I am learning ib_insync myself. So if you think that there might be a good additional feature added, feel free to let me know!
Rules:
If the first candle of the day closes above vwap, then buy.
If the first candle of the day closes below vwap, then sell.
(So the strategy is always either short or long from minute 2 of the day).
As the day progresses
If price crosses vwap from below, then close the pre existing short and initiate a long
If price crosses vwap from above, then close the pre existing long and initiate a short
Exit all positions at 15:58 oclock.
So basically the strategy just trades the crossover between price and vwap.
I also need to add several features to it.
For profit taking:
-if price rose by X% from the entry, add a stop loss = entry price
-if price rose by Y% (Y is bigger than X) from the entry, then cancel the previous stop loss, and instead add a trailing stop that trails by half of the distance traveled.
Example for X=5% and Y=15%:
Strategy is long at $100, once price rose by 5% to $105, a stop loss is added at $100, once price rose by 15% from the entry to $115, stop loss is cancelled and trailing stop is added. Trail amount is the half the distance that the price moved, so the move was $15, 15/2 = 7.5. Trailing stop at: $115 minus $7.5 = 107.5$.
Also, I want to be able to set limits for the amount by which price crosses vwap.
For example, lets say we had a big move and price crossed vwap from below and closed 20% away from vwap. Thats is a very extereme and rare event and I want to ignore them (ignore meaning that startegy wont trade on those signals). So ideally I want the strategy to trade only when the abs(amount by which price crosse vwap) is <= W%. W is a variable that can be altered.
Finally, an optional parameter that can be either turned on or off:
if OFF, then strategy trades the entire day
if ON, then strategy does not enter new positions between 12:30:00 and 13:30:00 (again i want to be able to modify the times)
Why so many additional features in the strategy?
I need a template that has a bunch different features implemented that I can use and copy paste from as I am learning ib_insync myself. So if you think that there might be a good additional feature added, feel free to let me know!