NexusFi: Find Your Edge


Home Menu

 





Bot Trading - MCL Futures


Discussion in EasyLanguage Programming

Updated
      Top Posters
    1. looks_one syswizard with 30 posts (6 thanks)
    2. looks_two kevinkdog with 26 posts (27 thanks)
    3. looks_3 Hulk with 9 posts (20 thanks)
    4. looks_4 SMCJB with 9 posts (13 thanks)
      Best Posters
    1. looks_one Hulk with 2.2 thanks per post
    2. looks_two FastNCurious with 1.8 thanks per post
    3. looks_3 SMCJB with 1.4 thanks per post
    4. looks_4 kevinkdog with 1 thanks per post
    1. trending_up 22,121 views
    2. thumb_up 114 thanks given
    3. group 457 followers
    1. forum 119 posts
    2. attach_file 15 attachments




 
Search this Thread

Bot Trading - MCL Futures

  #91 (permalink)
 jeronymite   is a Vendor
 
Posts: 21 since Jul 2013
Thanks Given: 6
Thanks Received: 22

Thanks for the post, and in the spirit of trying to understand the power of the post, may I ask, as a NinjaTrader (only) user, if the strategy can be "translated" into NinjaTrader terms, please? Not code (unless it's readily available, of course), but a description that defines the strategy independent of EasyLanguage.

Thanks.

Reply With Quote
Thanked by:

Can you help answer these questions
from other members on NexusFi?
Trade idea based off three indicators.
Traders Hideout
Better Renko Gaps
The Elite Circle
Pivot Indicator like the old SwingTemp by Big Mike
NinjaTrader
ZombieSqueeze
Platforms and Indicators
Bigger Wins or Fewer Losses?
Traders Hideout
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Just another trading journal: PA, Wyckoff & Trends
33 thanks
Tao te Trade: way of the WLD
24 thanks
My NQ Trading Journal
14 thanks
HumbleTraders next chapter
11 thanks
GFIs1 1 DAX trade per day journal
11 thanks
  #92 (permalink)
gurji
Miami, Florida
 
Posts: 35 since Apr 2022
Thanks Given: 1
Thanks Received: 10

Hey Guys, I am new to this forum and just saw this post. I have been trading almost exclusively CL, and I have been working on a strategy using tradingview for the past 2 months. I am in the process now of developing a bot. But as I am sure some of you know, it is easier said than done. I have it made in tradestation, but I cannot stand tradestation's desktop app. I am woking on integration with the API instead, and it will run on a server in conjunction with tradingview webhooks/alerts.

The strategy runs on 5 minute chart and has very small trades. Avg win after broker and fees is $30 ($0.03 on the CL chart). It wins about 85-90% of the time, however, the stops are a much bigger than the profits.
Per tradingview strategy tester, this wins in a consistent incline on their strategy testing report.
I am still trying to find more ways of reducing the stoploss.
Also, since I am using the 5 minute chart for this, I can't go further back than about 20,000 candles which is about 2 months or so.

It also works well with some input changes on NG, SI, ETH, and RBOB. However, RBOB the stoploss is much smaller and is actually less than the profit target. However, the percentage of wins is much less. Still a winner.


I am willing to share with someone else that wants to share their strategy and exchange ideas. However, in private messages, not public.

I attached a performance report from tradingview here.

Attached Files
Elite Membership required to download: Strategy_Performance_Summary_2022-09-15.csv
Reply With Quote
Thanked by:
  #93 (permalink)
 
Hulk's Avatar
 Hulk 
Texas, USA
 
Experience: Advanced
Platform: TT, Custom
Trading: Futures, Spreads
Posts: 369 since May 2014
Thanks Given: 731
Thanks Received: 901



gurji View Post
Hey Guys, I am new to this forum and just saw this post. I have been trading almost exclusively CL, and I have been working on a strategy using tradingview for the past 2 months. I am in the process now of developing a bot. But as I am sure some of you know, it is easier said than done. I have it made in tradestation, but I cannot stand tradestation's desktop app. I am woking on integration with the API instead, and it will run on a server in conjunction with tradingview webhooks/alerts.

The strategy runs on 5 minute chart and has very small trades. Avg win after broker and fees is $30 ($0.03 on the CL chart). It wins about 85-90% of the time, however, the stops are a much bigger than the profits.
Per tradingview strategy tester, this wins in a consistent incline on their strategy testing report.
I am still trying to find more ways of reducing the stoploss.
Also, since I am using the 5 minute chart for this, I can't go further back than about 20,000 candles which is about 2 months or so.

It also works well with some input changes on NG, SI, ETH, and RBOB. However, RBOB the stoploss is much smaller and is actually less than the profit target. However, the percentage of wins is much less. Still a winner.


I am willing to share with someone else that wants to share their strategy and exchange ideas. However, in private messages, not public.

I attached a performance report from tradingview here.

I strongly urge you to reconsider this strategy. These markets are not for scalping 3 ticks in WTI when the bid/ask spread is 2 ticks minimum. And RBOB? The spread is at best 15-20 ticks, its double that overnight. Considering that you backtested on 5 minute bars, I am guessing your strategy assumes it gets filled at the closing or opening price of these bars. Even with a bot, it is very unlikely your strategy will be profitable because you wont be able to replicate your backtested fills.

Visit my NexusFi Trade Journal Reply With Quote
Thanked by:
  #94 (permalink)
 
syswizard's Avatar
 syswizard 
Philadelphia PA
 
Experience: Advanced
Platform: Multicharts
Broker: Ironbeam, Rithmic
Trading: Emini ES / NQ / CL / RTY / YM / BTC
Posts: 344 since Jan 2019
Thanks Given: 20
Thanks Received: 146


jeronymite View Post
Thanks for the post, and in the spirit of trying to understand the power of the post, may I ask, as a NinjaTrader (only) user, if the strategy can be "translated" into NinjaTrader terms, please?

Sorry, I'm not a Ninja programmer.

Reply With Quote
  #95 (permalink)
gurji
Miami, Florida
 
Posts: 35 since Apr 2022
Thanks Given: 1
Thanks Received: 10


Hulk View Post
I strongly urge you to reconsider this strategy. These markets are not for scalping 3 ticks in WTI when the bid/ask spread is 2 ticks minimum. And RBOB? The spread is at best 15-20 ticks, its double that overnight. Considering that you backtested on 5 minute bars, I am guessing your strategy assumes it gets filled at the closing or opening price of these bars. Even with a bot, it is very unlikely your strategy will be profitable because you wont be able to replicate your backtested fills.

Hi, let me clarify it a little better. For CL, it is after the spread and broker fees that the avg win is $30. It has set a minimum win of 7 ticks which covers the spread and fees. You can easily bump up the min take profit ticks and still be very profitable. I just bumped it up to minimum 10 ticks and the %win rate only lost 1 point and average win is $109.43 There is plenty of room for tuning it.

For RBOB, completely different settings and bigger amounts. However, I haven't given much effort in the RBOB fine tuning yet. And as you have pointed out the large RBOB spread, I would only use it during the busy hours of the day when the spread is small.
I have only put real time into looking at it for CL. The others were a lot more briefly just looking at it and eyeballing it. Sorry for not making that clear.

I am new to doing a lot of this stuff, so I am sure that I may make some rookie mistakes. However, I am very good with programming/coding and math, so I can sit and play with this all day.
The one thing lacking tradingview is a solver that can automatically play with the inputs until it finds a good combination.

BTW, the method I use does work on other time frames with higher numbers. I just tend to be a bit impatient, so the short timeframes with low numbers work a little better for me.

I'm happy to share privately.

Reply With Quote
Thanked by:
  #96 (permalink)
 
Hulk's Avatar
 Hulk 
Texas, USA
 
Experience: Advanced
Platform: TT, Custom
Trading: Futures, Spreads
Posts: 369 since May 2014
Thanks Given: 731
Thanks Received: 901


gurji View Post
I am new to doing a lot of this stuff, so I am sure that I may make some rookie mistakes. However, I am very good with programming/coding and math, so I can sit and play with this all day.
The one thing lacking tradingview is a solver that can automatically play with the inputs until it finds a good combination.

Since you are new and you are good at math and programming, consider this: there are 2 things needed to make a model - data and math. If you use the same data and the same math as everyone else, your results will be the same as everyone else and so will your performance. And we already know how the majority performs. Unless you can invent new math, get creative with data. Building your own backtesting tool and working with raw data (not data via some platform) to generate your own, unique model data will be the best investment you make in this process.

For getting data, there is a new startup that I just came across called databento (databento.com). For CME only, they seem to have whatever granularity of data one would want from just end of day OHLC to MBO. Pricing is very reasonable.

Visit my NexusFi Trade Journal Reply With Quote
  #97 (permalink)
gurji
Miami, Florida
 
Posts: 35 since Apr 2022
Thanks Given: 1
Thanks Received: 10


Hulk View Post
Since you are new and you are good at math and programming, consider this: there are 2 things needed to make a model - data and math. If you use the same data and the same math as everyone else, your results will be the same as everyone else and so will your performance. And we already know how the majority performs. Unless you can invent new math, get creative with data. Building your own backtesting tool and working with raw data (not data via some platform) to generate your own, unique model data will be the best investment you make in this process.

For getting data, there is a new startup that I just came across called databento (databento.com). For CME only, they seem to have whatever granularity of data one would want from just end of day OHLC to MBO. Pricing is very reasonable.

Thanks, I will look at what they offer.

Reply With Quote
  #98 (permalink)
 
SMCJB's Avatar
 SMCJB 
Houston TX
Legendary Market Wizard
 
Experience: Advanced
Platform: TT and Stellar
Broker: Advantage Futures
Trading: Primarily Energy but also a little Equities, Fixed Income, Metals and Crypto.
Frequency: Many times daily
Duration: Never
Posts: 5,049 since Dec 2013
Thanks Given: 4,384
Thanks Received: 10,206


syswizard View Post
Sorry, I'm not a Ninja programmer.

Without knowing what the functions szVolatility and szAwesomeOsc are, nobody can convert it to NT. Your system is a bit of a black box and maybe not the simple system that others have posted here.

Reply With Quote
  #99 (permalink)
 
FatTailChaser's Avatar
 FatTailChaser 
Chicago, Illinois
 
Experience: Intermediate
Platform: Sierra Charts
Broker: Dorman
Trading: ZN
Posts: 10 since Apr 2022
Thanks Given: 1
Thanks Received: 14


gftrader View Post
Curious as to whether anyone has been able to code a profitable trading bot specifically for CL or MCL futures? I have been working to accomplish this, and wanted to see if anyone else had a successful bot they were willing to share. Appreciate it!


Hello Everyone, Im downloading 5 yrs of bars to do a longer backtest right now so while I'm waiting I thought I might join this conversation and share what I've been working on with crude today. I do all my trading and backtesting through Sierra charts, currently using the spreadsheets as I only know some python and they generally meet my needs. Something I've been doing lately with intraday momentum strategies is trying to forecast future volatility as one of my filters. Volatility tends to cluster as the staticians say and since I know I'm writing systems that benefit from market volatility I've tried different ways of forecasting using ema's of vol over different time periods. My results across the board have been much better than before filtering for vol and coupling that with a trend filter and a few other params like entry and exit I've found multiple ways to put something profitable together.

These are the results from my last test with CL today


Trade Statistics First Fill Last Fill Daily Date
[Sim]All Symbols Num Fills Filtered: 0 2022-06-01 08:20:59 2022-09-14 10:01:59 2022-09-14
All Accounts
Currency Value (C)
All Trades Long Trades Short Trades Daily Trades
Closed Trades Profit/Loss 9590.00 4100.00 5490.00 690.00
Closed Trades Total Profit 26140.00 6010.00 20130.00 710.00
Closed Trades Total Loss -16550.00 -1910.00 -14640.00 -20.00
Profit Factor 1.58 3.15 1.38 35.50

Equity Peak 11240.00 5130.00 6970.00 710.00
Equity Valley 8260.00 3410.00 4040.00 690.00
Maximum Runup 8330.00 5130.00 7620.00 710.00
Maximum Drawdown -2980.00 -1720.00 -2890.00 -20.00
Maximum FlatToFlat Trade Open Profit 3660.00 1580.00 3660.00 1060.00
Maximum FlatToFlat Trade Open Loss -1140.00 -730.00 -1140.00 -250.00
Average Trade Open Profit 664.94 642.11 671.52 805.00
Average Trade Open Loss -313.88 -203.16 -345.76 -145.00
Average Winning Trade Open Profit 1208.16 917.27 1326.67 1060.00
Average Winning Trade Open Loss -189.47 -151.82 -204.81 -250.00
Average Losing Trade Open Profit 225.74 263.75 217.95 550.00
Average Losing Trade Open Loss -414.47 -273.75 -443.33 -40.00
Maximum Trade Open Profit 3660.00 1580.00 3660.00 1060.00
Maximum Trade Open Loss -1140.00 -730.00 -1140.00 -250.00
Highest Price During Positions 0.00 0.00 0.00 0.00
Lowest Price During Positions 0.00 0.00 0.00 0.00
Total Commissions 0.00 0.00 0.00 0.00

Total Trades 85 19 66 2
Total FlatToFlat Trades 85 19 66 2
Total Filled Quantity 170 38 132 4
Total Buys x Sells -47 x -47 19 x 19 -66 x -66 2 x 2
Percent Profitable 44.71% 57.89% 40.91% 50.00%
FlatToFlat Percent Profitable 44.71% 57.89% 40.91% 50.00%
Winning Trades 38 11 27 1
Winning FlatToFlat Trades 38 11 27 1
Losing Trades 47 8 39 1
Losing FlatToFlat Trades 47 8 39 1
Long Trades 19 19 0 2
Long FlatToFlat Trades 19 19 0 2
Short Trades 66 0 66 0
Short FlatToFlat Trades 66 0 66 0

Average Trade Profit/Loss 112.82 215.79 83.18 345.00
Average FlatToFlat Trade Profit/Loss 112.82 215.79 83.18 345.00
Average Winning Trade 687.89 546.36 745.56 710.00
Average FlatToFlat Winning Trade 687.89 546.36 745.56 710.00
Average Losing Trade -352.13 -238.75 -375.38 -20.00
Average FlatToFlat Losing Trade -352.13 -238.75 -375.38 -20.00
Average Profit Factor 1.95 2.29 1.99 35.50
Average FlatToFlat Profit Factor 1.95 2.29 1.99 35.50

Largest Winning Trade 2690.00 1160.00 2690.00 710.00
Largest FlatToFlat Winning Trade 2690.00 1160.00 2690.00 710.00
Largest Losing Trade -1070.00 -720.00 -1070.00 -20.00
Largest FlatToFlat Losing Trade -1070.00 -720.00 -1070.00 -20.00
Largest Winner % of Profit 10.29% 19.30% 13.36% 100.00%
Largest FlatToFlat Winner % of Profit 10.29% 19.30% 13.36% 100.00%
Largest Loser % of Loss 6.47% 37.70% 7.31% 100.00%
Largest FlatToFlat Loser % of Loss 6.47% 37.70% 7.31% 100.00%

Max Consecutive Winners 9 9 4 1
Max Consecutive Losers 7 4 7 0

Average Time In Trades 21:43 24:05 21:02 31:00
Average Time In Winning Trades 32:15 31:10 32:41 38:00
Average Time In Losing Trades 13:13 14:22 12:59 24:00
Longest Held Winning Trade 1:26:00 51:59 1:26:00 38:00
Longest Held Losing Trade 46:59 24:00 46:59 24:00

Total Quantity 85 19 66 2
Winning Quantity 38 11 27 1
Losing Quantity 47 8 39 1

Avg Quantity Per Trade 1.00 1.00 1.00 1.00
Avg Quantity Per FlatToFlat Trade 1.00 1.00 1.00 1.00
Avg Quantity Per Winning Trade 1.00 1.00 1.00 1.00
Avg Quantity Per FlatToFlat Winning Trade 1.00 1.00 1.00 1.00
Avg Quantity Per Losing Trade 1.00 1.00 1.00 1.00
Avg Quantity Per FlatToFlat Losing Trade 1.00 1.00 1.00 1.00
Largest Trade Quantity 1 1 1 1
Largest FlatToFlat Trade Quantity 1 1 1 1
Maximum Open Position Quantity 1 1 1 1

Last Trade Profit / Loss -20.00 -20.00 -620.00 -20.00
Last FlatToFlat Trade Profit / Loss -20.00 -20.00 -620.00 -20.00
Expectancy 112.82 0.00 0.00 0.00

Number of Open Trades 0
Open Trades: Open Quantity 0
Open Trades: Average Entry Price 0.00

Consecutive Winners Frequency Average Profit/Loss Avg Next Trade
1 Winners 14 711.43 -337.14
2 Winners 4 1125.00 -267.50
3 Winners 1 2350.00 -550.00
4 Winners 1 4200.00 -190.00
9 Winners 1 5130.00 -260.00
Frequency Average Profit/Loss Avg Next Trade
Consecutive Losers Frequency Average Profit/Loss Avg Next Trade
1 Losers 10 -327.00 515.00
2 Losers 3 -793.33 470.00
3 Losers 3 -1123.33 760.00
4 Losers 1 -1930.00 2640.00
5 Losers 2 -1570.00 380.00
7 Losers 1 -2440.00 230.00

Reply With Quote
  #100 (permalink)
 
SMCJB's Avatar
 SMCJB 
Houston TX
Legendary Market Wizard
 
Experience: Advanced
Platform: TT and Stellar
Broker: Advantage Futures
Trading: Primarily Energy but also a little Equities, Fixed Income, Metals and Crypto.
Frequency: Many times daily
Duration: Never
Posts: 5,049 since Dec 2013
Thanks Given: 4,384
Thanks Received: 10,206



FatTailChaser View Post
I've tried different ways of forecasting using ema's of vol over different time periods.

Google GARCH

Reply With Quote
Thanked by:




Last Updated on September 23, 2022


© 2024 NexusFi™, s.a., All Rights Reserved.
Av Ricardo J. Alfaro, Century Tower, Panama City, Panama, Ph: +507 833-9432 (Panama and Intl), +1 888-312-3001 (USA and Canada)
All information is for educational use only and is not investment advice. There is a substantial risk of loss in trading commodity futures, stocks, options and foreign exchange products. Past performance is not indicative of future results.
About Us - Contact Us - Site Rules, Acceptable Use, and Terms and Conditions - Privacy Policy - Downloads - Top
no new posts