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 Hulk with 9 posts (19 thanks)
    4. looks_4 SMCJB with 9 posts (13 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 8,958 views
    2. thumb_up 112 thanks given
    3. group 456 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)
  #111 (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


syswizard View Post
How important did you find volatility to be incorporated into your systems ?

In the past two weeks I just started incorporating it into backtesting in a systematic way so I can only tell you how its changed the results on different systems for me. It has in general reduced the number of trades significantly and also increased my win rate. I started toying with the idea because I was coding a system that looks for volatility expansion. I was using 63.33% of the volume traded since the previous pit session close as my idea of the area of normal random fluctuation, then filtering by mom, rvol, delta of the bar as an entry. I realized that I am obviously looking for periods of volatility so I brushed up on some vol forecasting methods and stated testing that as a filter on different time frames. Filtering on a daily level has great results but less trades than I was looking for that particular system. Do you incorporate a vol filter as an entry condition for your momentum Strats?

Reply With Quote
The following 2 users say Thank You to FatTailChaser for this post:

Can you help answer these questions
from other members on futures io?
Effect of Bitcoin price on Altcoins
Crypto Futures
AddPlotNames2a support thread
NinjaTrader
Realtest vs Amibroker
Platforms and Indicators
SafeDayTradingorg
Trading Reviews and Vendors
What are people who makes their living off of applying s …
Traders Hideout
 
 
(login for full post details)
  #112 (permalink)
 syswizard 
Philadelphia PA
 
Experience: Advanced
Platform: Multicharts
Broker: Ironbeam, Rithmic
Trading: Emini ES / NQ / CL / RTY / YM / BTC
 
syswizard's Avatar
 
Posts: 226 since Jan 2019
Thanks: 12 given, 101 received


FatTailChaser View Post
Do you incorporate a vol filter as an entry condition for your momentum Strats?

Not yet. I do use it however in setting Stop Losses and Take Profit targets.
See lower indicator in the attachment. I sometimes use the Average line value outright (white line), but sometimes use the ratio of the actual volatility to the average times the average. This ratio can range from 0.5 to 2.0.

Reply With Quote
 
(login for full post details)
  #113 (permalink)
kls06541
New York
 
 
Posts: 13 since Aug 2022
Thanks: 7 given, 0 received



FatTailChaser View Post
Sure bud, that test was pretty simple so I don't mind sharing. That system is trading a 30 min range breakout executing off of a 5 min chart with a daily chart 20 period momentum overlaid onto the 5. The inputs in the 5min chart are high/low over time period so that you get your opening range. High/Low over N bars as the exit parameter, that test is using 1 bar so it exits on a break of the low of the previous 5 min. Entry is filtered directionally by the mom of the daily and by an exponential moving average of the atr to filter for expanding volatility. I use the slope of that ma in the test. Im not going to give you parameters to use but that's the framework for that specific backtest.

My point was more so to join the conversation and share some ways of looking at building systems like these that have helped me like starting to filter for volatility when I'm putting together any momentum strategy. If you have any questions or thoughts feel free to share, Ive been writing a lot of different systems lately so I'm definitely interested in what you guys have found useful too.

Thank you for your reply. I am a beginner, so I am still finding this difficult to understand. I hope to read more and more until I understand.

Reply With Quote
 
(login for full post details)
  #114 (permalink)
koganam
Garner, NC/USA
 
 
Posts: 38 since Dec 2009
Thanks: 16 given, 42 received


jeronymite View Post
It was in respect of @kevinkdog but applies to @syswizard as well.

Thanks.

 
Code
input: daysback(65),stopl(3000),fac(1.5);
//Use a lookback of 65
//Use a StopLoss of 3000 from the entry price
//Use a TargetToStopLossFactor of 1.5 times

if ADX(14)>10 and close-close[daysback] crosses above 0 then buy next bar at market;
//if ADX(14) is greater than 10, and Close[1] is less than Close[lookback + 1], and Close[0] is greater than Close[lookback], buy at market

if ADX(14)>10 and close-close[daysback] crosses below 0 then sellshort next bar at market;
//if ADX(14) is less than 10, and Close[1] is greater than Close[lookback + 1], and Close[0] is less than Close[lookback], sell at market

//If you prefer, you can use Momentum of the lookback length crossing above or below zero.

SetStopLoss(StopLoss);
//Set Stop loss relative to entry price

SetProfitTarget(StopLoss * TargetToStopLossFactor);
//Set Target exit relative to entry price

Reply With Quote
 
(login for full post details)
  #115 (permalink)
 Fu510n 
Suffield, CT
 
Experience: Advanced
Platform: MultiCharts, TS, Python
Broker: IB, IQFeed, TS, Kraken
Trading: ES, NQ, RTY, YM, CL, RB, 6E
 
Fu510n's Avatar
 
Posts: 132 since Oct 2009
Thanks: 864 given, 133 received


syswizard View Post
Not yet. I do use it however in setting Stop Losses and Take Profit targets.
See lower indicator in the attachment. I sometimes use the Average line value outright (white line), but sometimes use the ratio of the actual volatility to the average times the average. This ratio can range from 0.5 to 2.0.

Are those custom indicators (e.g. _szylOBVPctSlope) or something that can be downloaded somewhere?

Thanks!

Follow me on Twitter Reply With Quote
 
(login for full post details)
  #116 (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


koganam View Post
 
Code
input: daysback(65),stopl(3000),fac(1.5);
//Use a lookback of 65
//Use a StopLoss of 3000 from the entry price
//Use a TargetToStopLossFactor of 1.5 times
...

Many thanks, koganam. Most useful.

Thanks.

Reply With Quote
 
(login for full post details)
  #117 (permalink)
 syswizard 
Philadelphia PA
 
Experience: Advanced
Platform: Multicharts
Broker: Ironbeam, Rithmic
Trading: Emini ES / NQ / CL / RTY / YM / BTC
 
syswizard's Avatar
 
Posts: 226 since Jan 2019
Thanks: 12 given, 101 received


Fu510n View Post
Are those custom indicators (e.g. _szylOBVPctSlope) or something that can be downloaded somewhere?
Thanks!

Strictly custom. I rarely use built-in indicators/signals.

Reply With Quote
The following user says Thank You to syswizard for this post:
 
(login for full post details)
  #118 (permalink)
soacm
Bucharest, Romania
 
 
Posts: 53 since Mar 2022
Thanks: 31 given, 11 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!

1 trade x week, Wednesday only, 15min Data1, Daily Data2, $20 of total commissions already included.
 
Code
// CRUDE inventories news, 15min Data1, Daily Data2

input: MyPerc(0.5), StartTime(300), EndTime(1000);

input: MyStopLoss(1500);

input: News(3);

vars: MaxSetup(0), 
      MinSetup(0),
      MP(0), 
      MyRange(0,Data2),
      MyTime(false),
      CanTrade(True);
          
          MP = Marketposition;
          MyTime = False;
          if Time >= StartTime and Time <= EndTime and EntriesToday(date[0]) < 1 then MyTime = True;
          
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////          
           
// Levels

var: CurSess(0);
     CurSess = CurrentSession(0);

if CurSess[1] <> CurSess then begin 
   
   CanTrade = True;
   MyRange =  HighSession(1,1) - LowSession(1,1); 
   MaxSetup = OpenSession(0,0) + MyRange*MyPerc; 
   MinSetup = OpenSession(0,0) - MyRange*MyPerc;
    
end;

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

// Entries

if 
MP = 0                                                      and 
MyTime = True                                               and 
Close < MaxSetup                                            and 
dayofweek(date) = News                                      then 

   begin 
      Buy next Bar at MaxSetup on Stop;
   end;
      if Time >= 1515 then Sell next bar at open;

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

if
MP = 0                                                      and 
MyTime = True                                               and
Close > MinSetup                                            and 
dayofweek(date) = News                                      then                                              

   begin 
      Sellshort next bar at MinSetup on Stop;
   end;
      if Time >= 1515 then Buytocover next bar at open;

// Exits

if MyStopLoss > 0 then Setstoploss(MyStopLoss);

Attached Thumbnails
Click image for larger version

Name:	Returns.png
Views:	29
Size:	32.6 KB
ID:	327157   Click image for larger version

Name:	Crudecurve.png
Views:	24
Size:	23.9 KB
ID:	327158  
Reply With Quote
The following 3 users say Thank You to soacm for this post:
 
(login for full post details)
  #119 (permalink)
kls06541
New York
 
 
Posts: 13 since Aug 2022
Thanks: 7 given, 0 received


soacm View Post
1 trade x week, Wednesday only, 15min Data1, Daily Data2, $20 of total commissions already included.

 
Code
// CRUDE inventories news, 15min Data1, Daily Data2



input: MyPerc(0.5), StartTime(300), EndTime(1000);



input: MyStopLoss(1500);



input: News(3);



vars: MaxSetup(0), 

      MinSetup(0),

      MP(0), 

      MyRange(0,Data2),

      MyTime(false),

      CanTrade(True);

          

          MP = Marketposition;

          MyTime = False;

          if Time >= StartTime and Time <= EndTime and EntriesToday(date[0]) < 1 then MyTime = True;

          

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////          

           

// Levels



var: CurSess(0);

     CurSess = CurrentSession(0);



if CurSess[1] <> CurSess then begin 

   

   CanTrade = True;

   MyRange =  HighSession(1,1) - LowSession(1,1); 

   MaxSetup = OpenSession(0,0) + MyRange*MyPerc; 

   MinSetup = OpenSession(0,0) - MyRange*MyPerc;

    

end;



////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////



// Entries



if 

MP = 0                                                      and 

MyTime = True                                               and 

Close < MaxSetup                                            and 

dayofweek(date) = News                                      then 



   begin 

      Buy next Bar at MaxSetup on Stop;

   end;

      if Time >= 1515 then Sell next bar at open;



////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////



if

MP = 0                                                      and 

MyTime = True                                               and

Close > MinSetup                                            and 

dayofweek(date) = News                                      then                                              



   begin 

      Sellshort next bar at MinSetup on Stop;

   end;

      if Time >= 1515 then Buytocover next bar at open;



// Exits



if MyStopLoss > 0 then Setstoploss(MyStopLoss);

Can you please explain in plain English how this strategy works?

Sent using the futures.io mobile app

Reply With Quote
 
(login for full post details)
  #120 (permalink)
soacm
Bucharest, Romania
 
 
Posts: 53 since Mar 2022
Thanks: 31 given, 11 received



kls06541 View Post
Can you please explain in plain English how this strategy works?

Sent using the futures.io mobile app

The strategy buys or sells if the range is broken during the time window (3am to 10pm exchange time). The trade is closed at the end of the session.
The range is calculated based on the previous daily range and half of it is taken (MyPerc 0.5) and added above and below today's open --> MaxSetup = OpenSession(0,0) + MyRange*MyPerc; MinSetup = OpenSession(0,0) - MyRange*MyPerc;

It trades on Wednesday only because it tries to take advantage of the increased volatility caused by the Crude Oil Inventories.

Reply With Quote
The following user says Thank You to soacm 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 © 2022 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