random strategy - add scaling in feature - MultiCharts | futures io social day trading
futures io futures trading


random strategy - add scaling in feature
Updated: Views / Replies:2,204 / 12
Created: by treydog999 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
 1  
 
Thread Tools Search this Thread
 

random strategy - add scaling in feature

  #11 (permalink)
Trading Apprentice
Stockholm, Sweden
 
Futures Experience: Intermediate
Platform: MultiCharts
Favorite Futures: FDAX
 
Posts: 3 since Jul 2016
Thanks: 4 given, 0 received

Hi guys,

I just joined the forum and was looking for a solution to a scale-in/scale-out problem similar as described in this thread. Like this:

(Platform: Multicharts)
1) I have a strategy that enters with 10 contracts All-in, sets 3 targets with different size. And this works fine.
2) I want to instead investigate how I can enter at multiple bars, 1 contract at a time. I thought this would be easy, but even though the contract accumulation is working correctly, all contracts are dumped on the first target even though I have monitored the size variable and it is set correctly.

Posting the code below. I am sure that this is a piece of cake many of you more experienced guys. Any help is really appreciated. Hope that I can help you guys with other things down the road.

Code for accumulating contracts. This works as expected.

 
Code
If currentcontracts=ContractMax then begin
ContractC=True; // ensures that once Contract Max is reached there will be no more orders that day to fill up
end;

positionsize=1;

IF InitialC AND DistanceC AND NOT ContractC THEN begin
Buy ("LONG Scale in trial") positionsize CONTRACTS next bar at Market;
END;
Code for calculating size and targets. I have monitored the 3 different sizes, and the calculations are correct.
However all 10 contracts are sold on "EXIT Long Target1".
 
Code
if currentcontracts <> 0 then begin 
	
	size1=maxlist(round(currentcontracts*0.4,0),0);
	size2=round(currentcontracts*0.333,0);
	size3=currentcontracts-size1-size2;

	Targetsize= TargetScale*entryprice;
	Stopsize=StopScale*entryprice;
	SL1 = entryprice-Stopsize;

	Target1 = Targetsize; 

	Targ= entryprice+Target1*0.75; 
	Targ2= entryprice+Target1*1.4; 
	Targ3= entryprice+Target1*1.6;

	// 
	IF (NOT Target1C) then begin // If Targ has not been hit

	sell ("Exit LONG Target1") size1 contracts Next Bar at (Targ) Limit;
	sell ("Exit LONG Target1.2") size2 contracts Next Bar at (Targ2) Limit;
	sell ("Exit LONG Target1.3") size3 contracts Next Bar at (Targ3) Limit;
	end;
	
	IF currentcontracts=size2+size3 then begin
	sell ("Exit LONG Target2") size2 contracts Next Bar at (Targ2) Limit;
	sell ("Exit LONG Target3") size3 contracts Next Bar at (Targ3) Limit;
	end;

	IF currentcontracts=size3 then begin
	sell ("Exit LONG Target2.3") size3 contracts Next Bar at (Targ3) Limit;
	end;

sell ("Exit Long SL1") currentcontracts contracts Next Bar at SL1 stop;

end;

Reply With Quote
 
  #12 (permalink)
 Vendor: www.abctradinggroup.com 
Hamburg Germany
 
Futures Experience: Advanced
Platform: Multicharts, Tradestation
Broker/Data: DTN IQ
Favorite Futures: ES
 
Posts: 1,839 since Apr 2013
Thanks: 298 given, 1,123 received
Forum Reputation: Legendary

PTJDAX,

you can look into the reserved word "total". This is the explanation from the manual:

Total
Used in strategy exit statements, following a numerical expression and the words Shares or Contracts, to indicate that only the number of contracts or shares specified by the numerical expression is to be sold or covered in total, regardless of the number of open entries. The contracts or shares will be sold or covered in the same order they were bought or shorted: First In, First Out.
If the word Total is not used, the number of contracts or shares specified by the numerical expression will be sold or covered for each one of the open entries.

If this doesn't give you the desired result you will have to tie the exit orders to specific entry orders. For example you can dynamically change the entry name for each order, so each entry is unique. You can for example add the number of contracts at the time of the entry (converted to a string).
This will also ensure that an exit is not re-used.

Regards,

ABCTG

Reply With Quote
The following user says Thank You to ABCTG for this post:
 
  #13 (permalink)
Trading Apprentice
Stockholm, Sweden
 
Futures Experience: Intermediate
Platform: MultiCharts
Favorite Futures: FDAX
 
Posts: 3 since Jul 2016
Thanks: 4 given, 0 received


Hi ABCTG,

That is really excellent advice. I just added "total" and it works as expected now.
Your second suggestion is also a good one and I'll keep that in mind for future work.
Many thanks once again, Vielen Dank nochmal, I really appreciate it.

Best Regards,

Reply With Quote

Reply



futures io > > > > random strategy - add scaling in feature

Thread Tools Search this Thread
Search this Thread:

Advanced Search



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

Journal Challenge w/Earn2Trade and $599 in Prizes

November
 

Anthony Drager: TBA

Nov 29
 

Linda Raschke: TBA

Elite only
 

Peter Davies: TBA

Dec 6
 

Brannigan Barrett: TBA

Elite only
 

Cannon Trading: Ask Me Anything

Dec 13
     

Similar Threads
Thread Thread Starter Forum Replies Last Post
All in all out vs. scaling in and out caprica Psychology and Money Management 130 December 27th, 2015 02:10 AM
How to add Strategy in a chart? dream3r NinjaTrader 7 October 2nd, 2014 03:32 AM
Techniques for scaling in DarkPoolTrading Psychology and Money Management 4 August 9th, 2012 03:27 PM
Scaling in and scaling out...when the total is NOT the sum of its parts RM99 Psychology and Money Management 8 April 11th, 2012 10:21 AM
Add to original position in NinjaTrader Strategy ryohkyo NinjaTrader Programming 5 March 14th, 2010 11:48 PM


Tags
6e, abc, backtesting, bigpointvalue, code, dom, dow, easylanguage, es, futures, how to, market position, marketposition, multicharts, order management, position size, realtime, reverse, scale in, scaling, signal, signals, sp, strategy, type, variable

All times are GMT -4. The time now is 06:41 AM. (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-11-22 in 0.09 seconds with 15 queries on phoenix