Hi,
x = any predefined range from the market open, i.e. If x = 15 and market open was 8am GMT, then we would have a range from 8am-8.15am, if x was 30, then we would have range from 8am-8.30am.
y = the target points above or below a break of x range. (user defined)
z = stop position. hard-coded number of points for your stop from entry.
Rules Take a break of the x range (+2pts) and the target is y. Stop is z. Thanks in advance.
Regards.
I don’t know what you mean by “take a break of range x” but maybe this will help
Z = 25
A = 50
B = 40
If currenttime=090000 then
Range1= open
Endif
If currenttime = 091500 then
Range2=close
Endif
If Range2>Range1 And Range2-Range1 > Z then
Buy 1 contract at market
Set Target Profit A
Set Stop Loss B
Elseif Range1 >Range2 And Range1-Range2 > Z then
Sellshort 1 contract at market
Set Target Profit A
Set Stop Loss B
Endif
:
I couldn’t use the PRT function because I am on mobile.
Thanks for the feedback Derek.
I will give this a go.
Best Regards.
I just did on my system. This is definitely working:
DEFPARAM CUMULATEORDERS = false
Rangetoenter = 50
TargetProfitinPoints = 50
StoplossinPoints = 40
IF currenttime = 090000 THEN
price1 = open
endif
IF currenttime = 091500 THEN
price2 = close
endif
If price2-price1 > 0 AND price2-price1 > Rangetoenter Then
Buy 1 contract at market
Set Target pProfit TargetProfitinPoints
Set stop pLOSS StoplossinPoints
elsif price1-price2 > 0 AND price1-price2 > Rangetoenter Then
SELLSHORT 1 contract at market
Set Target pProfit TargetProfitinPoints
Set stop pLOSS StoplossinPoints
endif
Hi,
So it seems I am taking multiple trades per day. I only want to have one trade per day.
So, imagine the open is 8am and I have defined a range of 15mins.
Therefore, I want to trade a break higher or a break lower of that opening 15m range until either Y is hit (hardcoded target points) OR Z is hit (hardcoded stop number of points)
This current script is not quite hitting the mark with that as it is taking multiple trades in a given day. Thanks in advance for details provided in order to correct it to allow this.