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


random strategy - add scaling in feature
Updated: Views / Replies:1,506 / 12
Created: by treydog999 Attachments:1

Welcome to futures io.

Welcome, Guest!

This forum was established to help traders (especially futures traders) by openly sharing indicators, strategies, methods, trading journals and discussing the psychology of trading.

We are fundamentally different than most other trading forums:
  • We work extremely hard to keep things positive on our forums.
  • We do not tolerate rude behavior, trolling, or vendor advertising in posts.
  • We firmly believe in openness and encourage sharing. The holy grail is within you, it is not something tangible you can download.
  • 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, and we will never resell your private information.

-- Big Mike

Reply
 1  
 
Thread Tools Search this Thread
 

random strategy - add scaling in feature

  #1 (permalink)
Elite Member
seoul, Korea
 
Futures Experience: Intermediate
Platform: Multicharts
Broker/Data: CQG, DTN IQfeed
Favorite Futures: YM 6E
 
treydog999's Avatar
 
Posts: 883 since Jul 2012
Thanks: 289 given, 999 received

random strategy - add scaling in feature

Hi I have a random entry generating strategy that can scale out. But I am having trouble implementing a scale in feature. I want to do coin toss experiments comparing scale in scale out and AIAO. but i just cant figure out how to add scaling in. I am looking to enter a random position then add 1 when the Market Position is = 1 or MP = -1.

can anyone help?

 
Code
input:
ProfitTarget( 0 ),
StopLoss (  0  ),
TicksPerPoint(10000),
Scaleout(false);

Variables: {---------------------------------------------------------------------------------}
vRandomNumber(0);

 vRandomNumber = Intportion( Random(100) );
 
   If ( vRandomNumber >= 50 ) and MP = 0 then
   	buy("LE") next bar at market;
   If ( vRandomNumber < 50 ) and MP = 0 then
	sellshort("SE") next bar at market;

If Scaleout = false then begin
If ProfitTarget > 0 then
	setprofittarget ((ProfitTarget*bigpointvalue)/TicksPerPoint);
If Stoploss > 0 then begin
	setstopcontract;
	setstoploss((Stoploss*bigpointvalue)/TicksPerPoint);
	end;

end;
//print(vRandomNumber, "  ", ProfitTarget*bigpointvalue);

if scaleout = true then begin
	if mp = 1 then begin
	sell 1 contract total next bar at (entryprice+(ProfitTarget/TicksPerPoint)) limit;
	sell 1 contract total next bar at (entryprice+2*(profittarget/TicksPerPoint)) limit;
	sell next bar at (entryprice-(StopLoss/TicksPerPoint)) stop;
	end;
	
	if mp = -1 then begin
	buytocover 1 contract total next bar  at (entryprice-(ProfitTarget/TicksPerPoint)) limit;
	buytocover 1 contract total next bar  at (entryprice-(2*ProfitTarget/TicksPerPoint)) limit;
	buytocover next bar at (entryprice+(StopLoss/TicksPerPoint)) stop;
	end;
	
end;

Reply With Quote
 
  #2 (permalink)
Market Wizard
Hamburg Germany
 
Futures Experience: Advanced
Platform: Multicharts, Tradestation, Multicharts.NET, NinjaTrader, MetaTrader
Broker/Data: DTN IQ
Favorite Futures: ES
 
Posts: 1,328 since Apr 2013
Thanks: 212 given, 755 received

treydog999,
what are the problems you are facing with the scale in part? Do you have it coded and it doesn't do what you have in mind or do you have problems with how to implement it?
If the signal is long and you want to scale in, should add positions on every new bar until the maximum allowed position size is reached?

Regards,
ABCTG

Reply With Quote
 
  #3 (permalink)
Elite Member
seoul, Korea
 
Futures Experience: Intermediate
Platform: Multicharts
Broker/Data: CQG, DTN IQfeed
Favorite Futures: YM 6E
 
treydog999's Avatar
 
Posts: 883 since Jul 2012
Thanks: 289 given, 999 received



ABCTG View Post
treydog999,
what are the problems you are facing with the scale in part? Do you have it coded and it doesn't do what you have in mind or do you have problems with how to implement it?
If the signal is long and you want to scale in, should add positions on every new bar until the maximum allowed position size is reached?

Regards,
ABCTG

I do not have it coded. I tried and failed. I posted the code above which does not scale in but can compile. I want it to scale in at a certain amount of ticks after entry which will be selectable. For example if we go long, i would like to select to scale in after 10 ticks in profit, or 10 ticks at a loss. Reverse for shorts. The above code does random generation already so its just a matter of figuring out how to add the new type of order management.

Reply With Quote
 
  #4 (permalink)
Elite Member
Colorado
 
Futures Experience: Advanced
Platform: MultiCharts
Broker/Data: IB & Iqfeed
Favorite Futures: ES , CL
 
sptrader's Avatar
 
Posts: 522 since Apr 2010
Thanks: 1,065 given, 662 received

I think you could get what you want by using the built-in functions Like- currentcontracts, marketposition and Entryprice;
For the second "scaled in" entry, Something like the code below (untested)..

 
Code
 if mp = 1 and currentcontracts = 1 then buy next bar at entryprice(0) +10 points stop;

Reply With Quote
 
  #5 (permalink)
Elite Member
seoul, Korea
 
Futures Experience: Intermediate
Platform: Multicharts
Broker/Data: CQG, DTN IQfeed
Favorite Futures: YM 6E
 
treydog999's Avatar
 
Posts: 883 since Jul 2012
Thanks: 289 given, 999 received


sptrader View Post
I think you could get what you want by using the built-in functions Like- currentcontracts, marketposition and Entryprice;
For the second "scaled in" entry, Something like the code below (untested)..

 
Code
 if mp = 1 and currentcontracts = 1 then buy next bar at entryprice(0) +10 points stop;

Yeah i been working with that. it just doesn't function right. I am doing this.

 
Code
IF MP = 1 and currentcontracts = 1 then
	buy ("LEscale") 1 contract next bar at entryprice(0) + .0008 stop;
IF MP = -1 and currentcontracts = 1 then
	sellshort("SEscale") 1 contracts next bar at entryprice(0) - .0008 stop;
its 6E so .0001 tick

Reply With Quote
 
  #6 (permalink)
Elite Member
seoul, Korea
 
Futures Experience: Intermediate
Platform: Multicharts
Broker/Data: CQG, DTN IQfeed
Favorite Futures: YM 6E
 
treydog999's Avatar
 
Posts: 883 since Jul 2012
Thanks: 289 given, 999 received

Actually it was a stupid mistake, i forgot to turn on scale in ability and recalculate my profit targets .

Reply With Quote
 
  #7 (permalink)
Elite Member
Colorado
 
Futures Experience: Advanced
Platform: MultiCharts
Broker/Data: IB & Iqfeed
Favorite Futures: ES , CL
 
sptrader's Avatar
 
Posts: 522 since Apr 2010
Thanks: 1,065 given, 662 received

Glad you figured it out- GLTY

Reply With Quote
 
  #8 (permalink)
Market Wizard
Hamburg Germany
 
Futures Experience: Advanced
Platform: Multicharts, Tradestation, Multicharts.NET, NinjaTrader, MetaTrader
Broker/Data: DTN IQ
Favorite Futures: ES
 
Posts: 1,328 since Apr 2013
Thanks: 212 given, 755 received

You might also want to take a look at the "Strategy Position Trades" reserved words, as they are build to handle entries and exits with multiple legs and in my opinion give you a lot
more control.

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



Regards,
ABCTG

Reply With Quote
The following 2 users say Thank You to ABCTG for this post:
 
  #9 (permalink)
Elite Member
OMAHA, NEBRASKA
 
Futures Experience: Intermediate
Platform: MULTICHARTS + TOS
Broker/Data: TRADESTATION + TOS
Favorite Futures: FUTURES
 
HectorPriamedes's Avatar
 
Posts: 22 since Sep 2011
Thanks: 29 given, 29 received

Scaling in AND Scaling out?

ABCTG (or others),

I was reading your reply post about scaling in/out in BM's advanced EasyLanguage video tutorial thread.

https://futures.io/multicharts/11278-video-tutorial-how-create-advanced-multicharts-easylanguage-strategy-3.html#post412706

That thread moved onto other topics. Since TreyDog created this thread just for scaling, and what I am doing is so similar, it makes more sense for me to post here and revive this thread.

TreyDog wanted to compare Scaling in and Scaling out to AIAO. I want to use Scaling In and Scaling Out simultaneously and indefinitely. Does regular Multicharts (not .NET) support this?

Must my entry and exit be coded in the same one signal for this to work? If my entry signal and my exit signal are each an independent signal with independent code, and both signals are added to the same chart, does scaling in and scaling out become impossible to achieve?

For scaling in, I was hoping to merely check the signal properties check box to "Allow up to _____ entry orders in the same direction... "

Meanwhile, on the exit side of things, I was building an independent exit signal to exit only 1 contract each time my exit signal is true and my CurrentEntries > 1.

I was hoping the combination of these two things would allow me to scale in and scale out repeatedly and indefinitely, possibly always being in a trade. (I understand I can't be long and short at once) My real question is with the scaling in and scaling out at the same time.

Thanks in advance.

Reply With Quote
 
  #10 (permalink)
Market Wizard
Hamburg Germany
 
Futures Experience: Advanced
Platform: Multicharts, Tradestation, Multicharts.NET, NinjaTrader, MetaTrader
Broker/Data: DTN IQ
Favorite Futures: ES
 
Posts: 1,328 since Apr 2013
Thanks: 212 given, 755 received


HectorPriamedes,

you can build that and it will work fine in backtesting. If you create issues in realtime will depend on your exact strategy. If you have multiple orders in the market, Multicharts will cancel and resend them in case one order changes.This can become problematic if you handle many open orders at the same time and constantly have to delete/change at least one of them.

Regards,
ABCTG

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

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)

FIO Journal Challenge featuring NinjaTrader ($2,000+ of prizes)

May

An overview of volumetric analytical tools w/Sergey Sokolov @ PTMC

Elite only

John Hoagland (TBA)

Elite only

FuturesTrader71 Extended Ask Me Anything (AMA)

Elite only

Pete @ Jigsaw Trading (TBA)

Elite only

John @ No BS Day Trading (TBA)

Elite only

An Afternoon with FIO member Softsoap (being rescheduled)

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 06:22 AM.

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-05-27 in 0.14 seconds with 20 queries on phoenix via your IP 54.162.91.86