Pyramid Scaling In and Scaling Out - EasyLanguage Programming | futures io social day trading
futures io futures trading


Pyramid Scaling In and Scaling Out
Updated: Views / Replies:226 / 10
Created: by tradestation18 Attachments:3

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
 3  
 
Thread Tools Search this Thread
 

Pyramid Scaling In and Scaling Out

  #1 (permalink)
Trading Apprentice
Porto Portugal
 
Futures Experience: Beginner
Platform: Tradestation
Favorite Futures: Crude
 
Posts: 6 since May 2018
Thanks: 0 given, 0 received

Pyramid Scaling In and Scaling Out

Hi,

I am trying to create a simple pyramid code with up to 6 cumulative entry orders and exiting with different/independent profit targets for each entry. The entries are triggered by a percentual retreat of the market. Example:
Entry1 at (High - 2%)
Entry2 at (Entry1-2%)
Entry3 at (Entry2-2%)
......

Exit1 at Entry1 + Profit Target 1
Exit1 at Entry2 + Profit Target 2
...

Developed this code which doesnt work properly namely: a) Too much orders withoud respecting the percentual retreat and
b) Sell orders not respecting the Profit Target defined ( Loss instead of profit)


I would be very much obliged if someone could help me on this. Thanks


[IntrabarOrderGeneration = false]
inputs:
PctPullBack( 1 ) , PositionBasis( False ), HD( 0 ), N(0.1), Capital (100000), Amount1 (1000), Price (Close) , // Profit target for first entry
Amount2(1000) , Amount3(1000), Amount4(1000), Amount5(1000), Amount6(1000); // Profit target for other entries


variables: HOD (0),Amt1(0),Amt2(0),Amt3(0),Amt4(0),Amt5(0),Amt6(0);

HOD = HighD( HD );



If CurrentBar> 1 then

Buy ( "ScaleIn 1" ) next bar at HOD * ( 1 - PctPullBack * .01 ) Limit ;
Amt1=Avgentryprice+Amount1*Avgentryprice/Capital ;// set profit tartet for 1st entry based on close of bar, not entryPrice end;
Buy ( "ScaleIn 2" ) next bar at HOD * ( 1 - (1+N)* PctPullBack * .01 ) Limit ;
Amt2=Avgentryprice+Amount2*Avgentryprice/Capital; // set profit tartet for 2nd entry based on close of bar, not entryPrice end;
Buy ( "ScaleIn 3" ) next bar at HOD * ( 1 - (1+2*N) * PctPullBack * .01 ) Limit ;
Amt3=Avgentryprice+Amount3*Avgentryprice/Capital;
Buy ( "ScaleIn 4" ) next bar at HOD * ( 1 - (1+3*N) * PctPullBack * .01 ) Limit ;
Amt4=Avgentryprice+Amount4*Avgentryprice/Capital;
Buy ( "ScaleIn 5" ) next bar at HOD * ( 1 - (1+4*N) * PctPullBack * .01 ) Limit ;
Amt5=Avgentryprice+Amount5*Avgentryprice/Capital;
Buy ( "ScaleIn 6" ) next bar at HOD * ( 1 - (1+5*N) * PctPullBack * .01 ) Limit ;
Amt6=Avgentryprice+Amount6*Avgentryprice/Capital;


sell ("LX1") from entry("ScaleIn 1") next bar at Amt1 limit;
sell ("LX2") from entry("ScaleIn 2") next bar at Amt2 limit; // will exit independently of 1st entry
sell ("LX3") from entry("ScaleIn 3") next bar at Amt3 limit; // will exit independently of other entries
sell ("LX4") from entry("ScaleIn 4") next bar at Amt4 limit; // will exit independently of 2nd entry
sell ("LX5") from entry("ScaleIn 5") next bar at Amt5 limit; // will exit independently of 1st entry
sell ("LX6") from entry("ScaleIn 6") next bar at Amt6 limit; // will exit independently of 2nd entry

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)
Market Wizard
Hamburg Germany
 
Futures Experience: Advanced
Platform: Multicharts, Tradestation
Broker/Data: DTN IQ
Favorite Futures: ES
 
Posts: 1,731 since Apr 2013
Thanks: 265 given, 998 received
Forum Reputation: Legendary


Hi tradestation18,

can you show an example of "a) Too much orders withoud respecting the percentual retreat and
b) Sell orders not respecting the Profit Target defined ( Loss instead of profit)" on chart and clarify how it should be instead in this situation?

Regards,

ABCTG

Reply With Quote
 
  #4 (permalink)
Trading Apprentice
Porto Portugal
 
Futures Experience: Beginner
Platform: Tradestation
Favorite Futures: Crude
 
Posts: 6 since May 2018
Thanks: 0 given, 0 received

Pyramid Scale in and Out

Thanks for your reply. PLease find attache the out put for the following settings:

- PctPullBack 1.5
- PositionBasis true
- HD 15
- N 1.5
- Capital 50000
- Amount1 1000
- Price Close
- Amount2 1250
- Amount3 1500
- Amount4 2000
- Amount5 2500
- Amount6 3000

Attached Thumbnails
Pyramid Scaling In and Scaling Out-ford.png  
Attached Files
Register to download File Type: xlsx FordList.xlsx (12.5 KB, 2 views)
Register to download File Type: xlsx Ford.xlsx (31.7 KB, 2 views)
Reply With Quote
 
  #5 (permalink)
Market Wizard
Hamburg Germany
 
Futures Experience: Advanced
Platform: Multicharts, Tradestation
Broker/Data: DTN IQ
Favorite Futures: ES
 
Posts: 1,731 since Apr 2013
Thanks: 265 given, 998 received
Forum Reputation: Legendary

tradestation18,

I would check the values for Amt1 to Amt6 using the print reserved word, as they might still be based on the previous entry during your entry bar.

Regards,

ABCTG

Reply With Quote
 
  #6 (permalink)
Trading Apprentice
Porto Portugal
 
Futures Experience: Beginner
Platform: Tradestation
Favorite Futures: Crude
 
Posts: 6 since May 2018
Thanks: 0 given, 0 received

Scaling in & Out

Thanks for the tip. Thats my difficulty how to link each entry ("ScaleIn 1"), ("ScaleIn 2").. to the corresponding desired amount of profit Amt1, Amt2,....., that is what should be the correct code for Amt1, Amt2, in order that it links to the corresponding entry ("ScaleIn 1"),("ScaleIn 2"), and not to the previous or actual price Close ...

Reply With Quote
 
  #7 (permalink)
Market Wizard
Hamburg Germany
 
Futures Experience: Advanced
Platform: Multicharts, Tradestation
Broker/Data: DTN IQ
Favorite Futures: ES
 
Posts: 1,731 since Apr 2013
Thanks: 265 given, 998 received
Forum Reputation: Legendary

Hi tradestation18,

what did the print statements show? This should clarify what needs to be done to give you the desired outcome.

Regards,

ABCTG


tradestation18 View Post
Thanks for the tip. Thats my difficulty how to link each entry ("ScaleIn 1"), ("ScaleIn 2").. to the corresponding desired amount of profit Amt1, Amt2,....., that is what should be the correct code for Amt1, Amt2, in order that it links to the corresponding entry ("ScaleIn 1"),("ScaleIn 2"), and not to the previous or actual price Close ...


Reply With Quote
 
  #8 (permalink)
Trading Apprentice
Porto Portugal
 
Futures Experience: Beginner
Platform: Tradestation
Favorite Futures: Crude
 
Posts: 6 since May 2018
Thanks: 0 given, 0 received

The output makes no sense. The sell order is coincident with the buy order, no matter the inputs are:


Type Date/Time Signal Price Roll Over Amt (USD) Shares/Ctrts/Units
Buy 07/31/14 ScaleIn 1 $36.54 $0.00 1368
Sell 07/31/14 LX1 $36.54 $0.00
Buy 08/14/14 ScaleIn 1 $35.08 $0.00 1425
Sell 08/14/14 LX1 $35.08 $0.00
Buy 09/02/14 ScaleIn 1 $34.75 $0.00 1438
Sell 09/02/14 LX1 $34.75

Reply With Quote
 
  #9 (permalink)
Market Wizard
Hamburg Germany
 
Futures Experience: Advanced
Platform: Multicharts, Tradestation
Broker/Data: DTN IQ
Favorite Futures: ES
 
Posts: 1,731 since Apr 2013
Thanks: 265 given, 998 received
Forum Reputation: Legendary

Hi tradestation18,

what code did you use to create this output? I suggested using the print statement as it might make sense to find out what values your code uses internally for the orders, to find out what you need to change to get the results you want.

What is the value within your code for "Avgentryprice" for example on the bar where you enter?

Regards,

ABCTG

Reply With Quote
 
  #10 (permalink)
Trading Apprentice
Porto Portugal
 
Futures Experience: Beginner
Platform: Tradestation
Favorite Futures: Crude
 
Posts: 6 since May 2018
Thanks: 0 given, 0 received


The code is very simple but doesnt work properly because each entry ("ScaleIn 1" and "ScaleIn 2") are not linked with the desired Profit Tareget Price Amt1 and Amt2.

inputs:
PctPullBack( 1 ) , PositionBasis( False ), HD( 0 ), N(0.1), Capital (100000), Amount1 (1000), Price (Close) ,
Amount2(1000) ;// Amount1 and Amount2 are the Profit target

variables: HOD (0),Amt1(0),Amt2(0);
HOD = HighD( HD );

If CurrentBar> 1 then

Buy ( "ScaleIn 1" ) next bar at HOD * ( 1 - PctPullBack * .01 ) Limit ;
Amt1=Close+Amount1*Close/Capital ;// set profit tartet for 1st entry based on close of bar, not entryPrice end;
Buy ( "ScaleIn 2" ) next bar at HOD * ( 1 - (1+N)* PctPullBack * .01 ) Limit ;
Amt2=Close+Amount2*Close/Capital; // set profit tartet for 2nd entry based on close of bar, not entryPrice end;


sell ("LX1") from entry("ScaleIn 1") next bar at Amt1 limit;
sell ("LX2") from entry("ScaleIn 2") next bar at Amt2 limit; // will exit independently of 1st entry

Reply With Quote

Reply



futures io > > > > > Pyramid Scaling In and Scaling Out

Thread Tools Search this Thread
Search this Thread:

Advanced Search



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

July Journal Challenge - $500 in Amazon Gift Cards!

July

Battlestations: $750 in prizes - Show us your trading desk!

August

TBA: FuturesTrader71 w/Morad Askar

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
Scaling-In vs Scaling-Out as a Tend.... mdsvtr Psychology and Money Management 2 October 28th, 2014 01:05 PM
How to pyramid? dog4 The Elite Circle 10 October 11th, 2013 09:53 AM
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
Nutrition Plate replaces Food Pyramid Big Mike Off-Topic 3 June 3rd, 2011 12:03 AM


All times are GMT -4. The time now is 07:52 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-07-21 in 0.09 seconds with 14 queries on phoenix