Trabajo finalizado
Tarea técnica
Please refer to the ZIP file containing the requirements. This post may not be formatted correctly to accurately reflect the requirements of this project.
Automated PJ Garcia Camarilla Insider Breakout Strategy
Expert Advisor for Meta Trader 5
This expert advisor will use the following camarilla pivot point equation for calculation of the pivot points that the system will use to determine entry, exit, risk, and trade management. The levels will also be plotted on the chart as well with options to adjust line color, thickness, design (dash, dot, dash-dot, solid). Options should allow for selected lines to be displayed or not displayed. Lines should be labeled (ex. R6, R5, etc.) and have the option in the settings to place the label on the far right or far left of the line.
This expert advisor will have 3 functions:
1. Indicator only (camarilla pivot points & central pivot range)
2. Manual execution of the expert advisor trading system True / False
3. Auto-pilot mode True / False
When #2 and #3 above are false, then “indicator only” mode is on.
When option #2 is set to true, then the expert advisor will execute trades based on whether price action hits R4 or S4 regardless of pivot width. It will follow the rules of entry, exit, partial profits, risk, trail stops, etc.
When #3 is set to true, then the expert advisor will execute trades on the chart selected based on conditions and rules such as current session pivot width in relation to previous session. The expert advisor will continue to monitor the camarilla pivots for trade signals until the expert advisor is closed.
The expert advisor will not allow both #2 & #3 to be set to true at the same time on one chart.
This system and strategy will enter positions long OR short depending on the entry signal and setup.
In order to correctly calculate the camarilla pivots correctly, there will be an option to check off the type of security being traded in the settings. After checking off the type of security being traded, the expert advisor will calculate based on the default time setting of the previous session as listed below:
ÿ Stocks/ ETF’s (9:30am to 4:00pm New York, USA time)
ÿ Forex Pairs (5pm to 5pm New York, USA time – 24 hours of data O,H,L,C)
ÿ Indices/ Gold/ Silver (6pm to 6pm New York, USA time – 24 hours of data O,H,L,C)
The session time frame is a very important component to this trading system. Without accurate time frame specifications, the camarilla pivot points will not be calculated correctly and result in inaccurate trade signals. In order for this system to trade correctly, the camarilla pivot points must be accurate.
On Friday, the Indice/Gold/Silver market closes at 5pm. Make sure the expert advisor does not give an error message on Monday for not being able to gather data from 5pm to 6pm on Fridays.
Camarilla Pivot Point Equation
R6 = (High/Low) x Close
R5 = R4 + 1.168 x (R4 – R3)
R4 = Close + RANGE × 1.1/2
R3 = Close + RANGE × 1.1/4
R2 = Close + RANGE × 1.1/6
R1 = Close + RANGE × 1.1/12
S1 = Close – RANGE × 1.1/12
S2 = Close – RANGE × 1.1/6
S3 = Close – RANGE × 1.1/4
S4 = Close – RANGE × 1.1/2
S5 = S4 – 1.168 x (S3 – S4)
S6 = Close – (R6 – Close)
*The “RANGE” is defined as the High minus the Low*
The following indicator, central pivot range (CPR) will be plotted on the chart, but no rules will apply. It is plotted for the traders reference.
Central Pivot Range Equation
TC = (Pivot – BC) + Pivot
Pivot = (High + Low + Close)/3
BC = (High + Low)/2
This expert advisor will initiate and manage a trade when the following criteria are met on the chart that this expert advisor is opened on.
Conditions for execution in a LONG position:
1. Price action is between (not outside of) the 4th camarilla pivots.
2. Once price action touches the R4 camarilla pivot, a long entry order at R4 is immediately executed with a stop loss at R3. The risk amount used will be calculated according to the distance between the entry and stop loss or a defined lot size. The entry should execute right on top of R4.
a. The risk options should be adjustable according to either:
2. Dollar amount (with 4 decimal spaces to accommodate FX pairs)
3. Fixed lot size
Profit taking orders will immediately be placed at the following levels after entry:
1. 50% at R5 camarilla Pivot
2. 25% at R6 camarilla Pivot
3. After the partials are taken at R5 and R6, then a trail stop should be executed for the remainder of the position. The trail stop distance should be equal to 40% of the distance between R4 and R6.
Stop-loss will be placed at the following levels as the trade progresses.
1. Upon entry, the stop loss will be at R3 for 100% of the position.
3. At the 2nd partial (R6), the stop loss will turn into a trailing stop for the remainder of the position.
a. The trailing stop loss distance will be as defined above in the profit taking orders section. There will be an option to adjust the % of distance between R4 and R6 for calculation of the trailing stop. The trail stop will be auto adjusted to reflect the position size after the 2nd partial is taken.
------------------------------------------------------------------------------------------------------------------------------------------
Conditions for execution in a SHORT position:
1. Price action is between (not outside of) the 4th camarilla pivots.
2. Once price action touches the S4 camarilla pivot, a short entry order at S4 is immediately executed with a stop loss at S3. The risk amount used will be calculated according to the distance between the entry and stop loss or a defined lot size. The entry should execute right on top of S4.
a. The risk options should be adjustable according to either:
1. % of account balance or
2. Dollar amount (with 4 decimal spaces to accommodate FX pairs)
3. Fixed lot size
Profit taking orders will immediately be placed at the following levels after entry:
1. 50% at S5 camarilla Pivot
2. 25% at S6 camarilla Pivot
3. After the partials are taken at S5 and S6, then a trail stop should be executed for the remainder of the position. The trail stop distance should be equal to 40% of the distance between S4 and S6.
*An option in the settings should allow for adjustment to the above profit taking amount in % with the above settings being the default. There should also be the option to “drag” the partial profit taking orders on the chart to adjust them. For example, at the last minute I may decide to move the R5 and R6 partial profit takers up on the chart. I want the ability to do so by simply dragging the lines.
Stop-loss will be placed at the following levels as the trade progresses.
1. Upon entry, the stop loss will be at S3 for 100% of the position.
2. At the 1st partial (S5), the stop-loss will move to break-even with adjusted size (because of the 1st partial).
3. At the 2nd partial (S6), the stop loss will turn into a trailing stop for the remainder of the position.
b. The trailing stop loss distance will be as defined above in the profit taking orders section. There will be an option to adjust the % of distance between S4 and S6 for calculation of the trailing stop. The trail stop will be auto adjusted to reflect the position size after the 2nd partial is taken.
------------------------------------------------------------------------------------------------------------------------------------------
The following settings should be adjustable in this expert advisor in the input tab with the following being the default:
Appearance:
Alternate Camarilla Pivot Point Calculation (Manual) Open: _____
High: ______
Low: ______
Close: _____
Pivot point time frame for manual calculation: Daily OR Weekly OR Monthly
Manually calculate Central Pivot Range using above data: True OR False
*” Alternate camarilla pivot point calculation” allows the trader to enter the previous sessions open, high, low and close. This expert advisor will use this manual calculation to determine entry, exit, risk, and trade management when it is used, otherwise it will default back to the automatic calculation of said levels.
R6 Pivot: Line Width: 3 Color: Dark Gray Design: Solid Label: Right Side
R5 Pivot: Line Width: 2 Color: Dark Gray Design: Dash Label: Right Side
R4 Pivot: Line Width: 3 Color: Green Design: Solid Label: Right Side
R3 Pivot: Line Width: 3 Color: Black Design: Solid Label: Right Side
R2 Pivot: Line Width: 1 Color: Black Design: Solid Label: None
R1 Pivot: Line Width: 1 Color: Black Design: Solid Label: None
S1 Pivot : Line Width: 1 Color: Black Design: Solid Label: None
S2 Pivot : Line Width: 1 Color: Black Design: Solid Label: None
S3 Pivot : Line Width: 3 Color: Black Design: Solid Label: Right Side
S4 Pivot : Line Width: 3 Color: Red Design: Solid Label: Right Side
S5 Pivot : Line Width: 2 Color: Dark Gray Design: Dash Label: Right Side
S6 Pivot : Line Width: 3 Color: Dark Gray Design: Solid Label: Right Side
TC Level: Line Width: 2 Color: Dark Yellow Design: Dash Label: None
Pivot: Line Width: 2 Color: White Design: Dash Label: None
BC Level: Line Width: 2 Color: Dark Yellow Design: Dash Label: None
Stop-Loss Line: Line Width: 2 Color: Blue Design: Dot Label: Left Side
Allow for the ability to drag the stop-loss line on the chart to adjust: True OR False
Entry Line: Line Width: 2 Color: Green Design: Dot Label: Left Side
Trail Stop Line: Line Width: 2 Color: Black Design: Dot Label: Left Side
Partial Profit: Line Width: 2 Color: Orange Design: Dot Label: Left Side
Allow for the ability to drag the Partial Profit line on the chart to adjust: True OR False
Long Entry Arrow: Color: Green
Short Entry Arrow: Color: Red
Long Close Arrow: Color: Red
Short Close Arrow: Color: Green
*These arrows are plotted on the chart to show where entries and exits were made
Risk Management
Risk Amount Per Trade $200 % of account balance OR $ amount OR Lot size
Automatically close trade by: ________ (Hr:Min) GMT -4:00 New York USA time
________ (Mm:Dd:Yyyy)
Auto Pilot Mode - Maximum Trades Per Session: 1
*If there is no data entered for the above time and date, then the trade will continue until closed by other parameters
Trade Management
1st partial Pivot Level OR Price: 5 Pivot Level Amount to Close: 50%
2nd partial Pivot Level OR Price: 6 Pivot Level Amount to Close: 25%
*The Pivot Level OR Price option here should allow me to be able to set the partial profit taking level at the pivot or at a particular dollar amount (4 decimals)
Stop trail amount % of distance between 4th and 6th pivots: 40% Amount to Close: 25%
*The percentage of partials and trail stop should add up to 100% total
Auto-pilot Mode: Entries will only be executed between 9:30am and 2pm (New York, USA time)
Distance between current session 3rd pivots in relation to previous session 3rd pivots: <= 70%
*An important condition for the auto-pilot mode is that the current session distance between R3 and S3 must be <= 70% of the previous sessions distance between R3 and S3. This distance should be adjustable in the settings as shown above.
*The entry, exit, risk, and management decisions the expert advisor makes should be based on the pivot levels plotted on the chart whether they were automatically calculated or manually entered through the manual calculation method. That means that if I adjust the R5 camarilla pivot level, the expert advisor will wait until the adjusted pivot level to take a partial.
Title for this expert advisor: “PJ Garcia Camarilla Insider Strategy”
Copyright name for this expert advisor: Pedro Garcia,
Version: 1.0
Logo (to be placed on the expert advisor):
I want the developer to use discretion on where these logos may be placed on the expert advisor.