Multicharts SetCustomFitnessValue for Equity Curve - EasyLanguage Programming | futures io social day trading
futures io futures trading


Multicharts SetCustomFitnessValue for Equity Curve
Updated: Views / Replies:3,325 / 4
Created: by benharrell Attachments:1

Welcome to futures io.

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

futures io is the largest futures trading community on the planet, with over 100,000 members. At futures io, our goal has always been and always will be to create a friendly, positive, forward-thinking community where members can openly share and discuss everything the world of trading has to offer. The community is one of the friendliest you will find on any subject, with members going out of their way to help others. Some of the primary differences between futures io and other trading sites revolve around the standards of our community. Those standards include a code of conduct for our members, as well as extremely high standards that govern which partners we do business with, and which products or services we recommend to our members.

At futures io, our focus is on quality education. No hype, gimmicks, or secret sauce. The truth is: trading is hard. To succeed, you need to surround yourself with the right support system, educational content, and trading mentors Ė all of which you can find on futures io, utilizing our social trading environment.

With futures io, you can find honest trading reviews on brokers, trading rooms, indicator packages, trading strategies, and much more. Our trading review process is highly moderated to ensure that only genuine users are allowed, so you donít need to worry about fake reviews.

We are fundamentally different than most other trading sites:
  • We are here to help. Just let us know what you need.
  • We work extremely hard to keep things positive in our community.
  • We do not tolerate rude behavior, trolling, or vendors advertising in posts.
  • We firmly believe in and encourage sharing. The holy grail is within you, we can help you find it.
  • We expect our members to participate and become a part of the community. Help yourself by helping others.

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

Reply
 
Thread Tools Search this Thread
 

Multicharts SetCustomFitnessValue for Equity Curve

  #1 (permalink)
Elite Member
Pittsburgh, Pa
 
Futures Experience: Intermediate
Platform: Ninjatrader
Broker/Data: Zen-Fire
Favorite Futures: CL,ES,6E
 
benharrell's Avatar
 
Posts: 235 since Aug 2009
Thanks: 350 given, 96 received

Multicharts SetCustomFitnessValue for Equity Curve

I am in the process of trying to figure out how to use the SetCustomFitnessValue in MC to optimize a specific system for a more linear equity curve. I have done some searching on the Multicharts forum, and here, and can't seem to find anyone trying or producing any examples. I did find an old EasyLanguage post, if you search on google for "set custom fitness value equity curve"

The resulting signal that I produced using code from that Forum (Kreslik), was:

 
Code
vars: 
   vTotalBars(0), 
   vAvgBarEqGrowth(0), 
   vAvgLinShift(0), 
   vLinEquity(0), 
   vMaxDev(0), 
   FitnessVal(0),
   tDiffSum(0), 
   tCounter(0); 

arrays: 
   aCumEquity[](0); 

if BarNumber >= 1 then 
   begin 
      Array_SetMaxIndex(aCumEquity, BarNumber); 
      aCumEquity[BarNumber] = NetProfit + OpenPositionProfit; 
      vTotalBars = BarNumber; 
   end;
   
if (numwintrades + numlostrades) > 0 then 
      begin 
         vAvgBarEqGrowth = aCumEquity[vTotalBars] / vTotalBars; 
         vLinEquity = vAvgBarEqGrowth; { linear equity at bar 1 
            will be equal to the average bar equity growth value} 

         for tCounter = 1 to vTotalBars 
            begin 
               tDiffSum = tDiffSum + (aCumEquity[tCounter] - vLinEquity); 
               vLinEquity = vLinEquity + vAvgBarEqGrowth; 
            end; 

         vAvgLinShift = tDiffSum / vTotalBars; { average deviation 
            from the perfectly linear, though shifted equity curve} 
         vLinEquity = vAvgBarEqGrowth; 

         for tCounter = 1 to vTotalBars 
            begin 
               vMaxDev = MaxList(vMaxDev, 
                  AbsValue(aCumEquity[tCounter] - (vLinEquity + vAvgLinShift))); 
               vLinEquity = vLinEquity + vAvgBarEqGrowth; 
            end; 

         FitnessVal = aCumEquity[vTotalBars] / vMaxDev; 
         SetCustomFitnessValue(FitnessVal);
      end;
The result was that MultiCharts crashed, I am using the most recent version of MC 8 64bit. I am not the best with EasyLanguage, but I am interested in finding out how to fix this. This is pretty experimental on my part, I don't know if it even makes sens to try and optimize for an equity curve alone.

If anyone is interested in helping, it might be great for the community to get this going.

By the way, I didn't post the link tot he forum where the code originated but would be willing to if it was allowed/required.

Reply With Quote
 
  #2 (permalink)
Quick Summary
Quick Summary Post

Quick Summary is created and edited by users like you... Add FAQ's, Links and other Relevant Information by clicking the edit button in the lower right hand corner of this message.

 
  #3 (permalink)
Elite Member
near Paris, France
 
Futures Experience: Beginner
Platform: -
Favorite Futures: -
 
Nicolas11's Avatar
 
Posts: 1,071 since Aug 2011
Thanks: 2,232 given, 1,725 received


Hi,

It is the first time I use custom fitness. But, this is something I wanted to test. So I take the opportunity of your message.

As you can see in the code, an array is created (aCumEquity). Its size is the number of bars on the screen. So, it may be huge. But should be OK.

However, at each bar, the code traverses twice all the existing bars on the screen: "for tCounter = 1 to vTotalBars". This is what seems strange to me. It generates an enormous amount of calculation.

On my computer, the implementation of a simple strategy (unprofitable MA crossover) takes a lot of time. And my computer has more or less frozen when I tried an optimization.

Do you think that the code within "if (numwintrades + numlostrades) > 0 [...] end" shall be executed at each bar, or only at the last?

If your answer is "only at the last", you could try to replace by "if LastBarOnChart AND (numwintrades + numlostrades) > 0 [...] end" and see what happens.

On my computer, it allowed a quick optimization (UPDATE: see screenshot below). But you have to check that the code is still fulfilling its purpose.

Nicolas

Please register on futures.io to view futures trading content such as post attachment(s), image(s), and screenshot(s).


Last edited by Nicolas11; June 26th, 2012 at 06:06 AM. Reason: addition of screenshot
Reply With Quote
The following user says Thank You to Nicolas11 for this post:
 
  #4 (permalink)
Elite Member
seoul, Korea
 
Futures Experience: Intermediate
Platform: Multicharts
Broker/Data: CQG, DTN IQfeed
Favorite Futures: YM 6E
 
treydog999's Avatar
 
Posts: 895 since Jul 2012
Thanks: 291 given, 1,008 received

I was looking on how to do this myself. I found a feature request put in by @BigMike on the multicharts Project Manager it says released. But i cant find it in the custom or pull down menu for optimization? Anyone figure out how to use it yet?

MultiCharts Project Management - Issue MC-896 - New optimization type - linear equity curve with minimal deviation

Reply With Quote
 
  #5 (permalink)
 Vendor: tradingcode.net 
The Netherlands
 
Futures Experience: None
Platform: MultiCharts, TradingView
Favorite Futures: ...
 
Jura's Avatar
 
Posts: 774 since Apr 2010
Thanks: 2,347 given, 665 received


treydog999 View Post
I was looking on how to do this myself. I found a feature request put in by @BigMike on the multicharts Project Manager it says released. But i cant find it in the custom or pull down menu for optimization? Anyone figure out how to use it yet?

MultiCharts Project Management - Issue MC-896 - New optimization type - linear equity curve with minimal deviation

It's available on the forum here. There's also a MC .NET version created by the same user.

Reply With Quote

Reply



futures io > > > > > Multicharts SetCustomFitnessValue for Equity Curve

Thread Tools Search this Thread
Search this Thread:

Advanced Search



Upcoming Webinars and Events (4:30PM ET unless noted)

September Journal Challenge (sponsored by TopstepTrader)

September

Free Elite Membership: Twitter Tuesday and Facebook Friday!

Tue & Fri

TopstepTrader (TBD)

Sep 25

RandBots (TBD)

Sep 27

Anthony Drager (TBD)

Oct 4
     

Similar Threads
Thread Thread Starter Forum Replies Last Post
Equity curve widget GoldStandard Traders Hideout 3 February 10th, 2014 01:23 PM
Equity curve trading - possible? DarkPoolTrading Psychology and Money Management 19 March 3rd, 2013 07:42 PM
Equity Curve Trading dgresens Psychology and Money Management 3 October 9th, 2011 04:54 PM
Image:backtesting-equity-curve.png Big Mike Trading Wiki Images 0 June 27th, 2010 08:05 AM
Check out this equity curve! MXASJ NinjaTrader Programming 5 May 29th, 2010 01:09 PM


All times are GMT -4. The time now is 01:26 PM. (this page content is cached, log in for real-time version)

Copyright © 2018 by futures io, s.a., Av Ricardo J. Alfaro, Century Tower, Panama, +507 833-9432, 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
Page generated 2018-09-22 in 0.13 seconds with 15 queries on phoenix