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:1,613 / 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 90,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)
Market Wizard
Hamburg Germany
 
Futures Experience: Advanced
Platform: Multicharts, Tradestation, Multicharts.NET, NinjaTrader, MetaTrader
Broker/Data: DTN IQ
Favorite Futures: ES
 
Posts: 1,409 since Apr 2013
Thanks: 220 given, 801 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)

July Journal Challenge w/$1100 in prizes from TopstepTrader

July
 

An Afternoon with FIO member Softsoap

Elite only

Battlestations: Show us your trading desks and win $750 in prizes

August
 

Extended Ask Me Anything w/Brett Steenbarger

Elite only

Prototyping Python Strategies (part 3) w/Ran Aroussi

Elite only

Brannigan Barrett w/Axia Futures

Elite only

Introduction to Phillip Capital futures brokerage services

Aug TBD

How Monte Carlo Analysis Can Help Your Trading w/Kevin Davey

Elite only
     

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 01:10 AM
How to add Strategy in a chart? dream3r NinjaTrader 7 October 2nd, 2014 02:32 AM
Techniques for scaling in DarkPoolTrading Psychology and Money Management 4 August 9th, 2012 02: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 09:21 AM
Add to original position in NinjaTrader Strategy ryohkyo NinjaTrader Programming 5 March 14th, 2010 10:48 PM


All times are GMT -4. The time now is 08:48 PM.

Copyright © 2017 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 2017-07-26 in 0.08 seconds with 20 queries on phoenix via your IP 54.224.109.48