Bot Trading - MCL Futures - futures io
futures io



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 SMCJB with 9 posts (13 thanks)
    4. looks_4 Hulk with 9 posts (19 thanks)
      Best Posters
    1. looks_one Hulk with 2.1 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 13,483 views
    2. thumb_up 113 thanks given
    3. group 459 followers
    1. forum 119 posts
    2. attach_file 15 attachments




Welcome to futures io: the largest futures trading community on the planet, with well over 150,000 members
  • Genuine reviews from real traders, not fake reviews from stealth vendors
  • Quality education from leading professional traders
  • We are a friendly, helpful, and positive community
  • We do not tolerate rude behavior, trolling, or vendors advertising in posts
  • We are here to help, just let us know what you need
You'll need to register in order to view the content of the threads and start contributing to our community.  It's free and simple.

-- Big Mike, Site Administrator

(If you already have an account, login at the top of the page)

 
Search this Thread
 

Bot Trading - MCL Futures

(login for full post details)
  #91 (permalink)
 jeronymite 
QLD Australia
 
Experience: Advanced
Platform: NinjaTrader
Broker: FXCM and NinjaTrader Brokerage
Trading: Forex, Futures
 
Posts: 17 since Jul 2013
Thanks: 5 given, 22 received

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
The following user says Thank You to jeronymite for this post:

Can you help answer these questions
from other members on futures io?
Demo accounts order fill
Emini and Emicro Index
Multi Time Frame High/Low/Median levels
NinjaTrader
Market on Close data within IB
Platforms and Indicators
Tradovate + Jigsaw issues
Tradovate
Book for fundamental analysis
Stocks and ETFs
 
Best Threads (Most Thanked)
in the last 7 days on futures io
Is anyone actually making money?
52 thanks
An embarrassing, honest confession
37 thanks
Sierra vs. Ninja : why I chose .....
8 thanks
Machine Learning Journal
5 thanks
Institutional Grade Massive Data Dump for Quant Research …
5 thanks
 
(login for full post details)
  #92 (permalink)
gurji
Miami, Florida
 
 
Posts: 29 since Apr 2022
Thanks: 1 given, 8 received

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
Register to download File Type: csv Strategy_Performance_Summary_2022-09-15.csv (1.1 KB, 23 views)
Reply With Quote
The following user says Thank You to gurji for this post:
 
(login for full post details)
  #93 (permalink)
 Hulk 
Texas, USA
 
Experience: Advanced
Platform: TT, Custom
Trading: Futures, Spreads
 
Hulk's Avatar
 
Posts: 360 since May 2014
Thanks: 707 given, 874 received



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 futures io Trade Journal Reply With Quote
The following 3 users say Thank You to Hulk for this post:
 
(login for full post details)
  #94 (permalink)
 syswizard 
Philadelphia PA
 
Experience: Advanced
Platform: Multicharts
Broker: Ironbeam, Rithmic
Trading: Emini ES / NQ / CL / RTY / YM / BTC
 
syswizard's Avatar
 
Posts: 344 since Jan 2019
Thanks: 20 given, 138 received


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
 
(login for full post details)
  #95 (permalink)
gurji
Miami, Florida
 
 
Posts: 29 since Apr 2022
Thanks: 1 given, 8 received


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
The following 4 users say Thank You to gurji for this post:
 
(login for full post details)
  #96 (permalink)
 Hulk 
Texas, USA
 
Experience: Advanced
Platform: TT, Custom
Trading: Futures, Spreads
 
Hulk's Avatar
 
Posts: 360 since May 2014
Thanks: 707 given, 874 received


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 futures io Trade Journal Reply With Quote
The following 4 users say Thank You to Hulk for this post:
 
(login for full post details)
  #97 (permalink)
gurji
Miami, Florida
 
 
Posts: 29 since Apr 2022
Thanks: 1 given, 8 received


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
 
(login for full post details)
  #98 (permalink)
 SMCJB 
Legendary Market Wizard
Normally Houston TX but in Colorado this month
 
Experience: Advanced
Platform: TT and Stellar
Broker: Primary Advantage Futures. Also ED&F and Tradestation
Trading: Primarily Energy but also a little Equities, Fixed Income, Metals and Crypto.
 
Posts: 4,758 since Dec 2013
Thanks: 4,081 given, 9,579 received


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
 
(login for full post details)
  #99 (permalink)
 FatTailChaser 
Chicago, Illinois
 
Experience: Intermediate
Platform: Sierra Charts
Broker: Dorman
Trading: ZN
 
FatTailChaser's Avatar
 
Posts: 9 since Apr 2022
Thanks: 1 given, 10 received


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
 
(login for full post details)
  #100 (permalink)
 SMCJB 
Legendary Market Wizard
Normally Houston TX but in Colorado this month
 
Experience: Advanced
Platform: TT and Stellar
Broker: Primary Advantage Futures. Also ED&F and Tradestation
Trading: Primarily Energy but also a little Equities, Fixed Income, Metals and Crypto.
 
Posts: 4,758 since Dec 2013
Thanks: 4,081 given, 9,579 received



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

Google GARCH

Reply With Quote
The following user says Thank You to SMCJB for this post:


futures io Trading Community Platforms and Indicators EasyLanguage Programming > Bot Trading - MCL Futures


Last Updated on September 23, 2022


Upcoming Webinars and Events
 

NinjaTrader Indicator Challenge!

Ongoing
     



Copyright © 2023 by futures io, s.a., Av Ricardo J. Alfaro, Century Tower, Panama, Ph: +507 833-9432 (Panama and Intl), +1 888-312-3001 (USA and Canada), info@futures.io
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.
no new posts