MACd auto trading Attempt
Forums › ProRealTime English forum › ProOrder support › MACd auto trading Attempt
- This topic has 21 replies, 4 voices, and was last updated 4 years ago by jebus89.
-
-
05/14/2019 at 4:13 AM #98412
Hello there every, new to this group.
Im attempting to set up an auto trader based on the MACd and i cant work out why its buying and selling at the same time. See attached pic
Nothing i change seems to make a difference to it, can any body please assist?
Cheers
DJ
05/14/2019 at 6:20 AM #98414Please post your code so we can help find out any issue.
We need to be able to replicate your trades.
You also need to tell us:
- Instrument
- Time frame used
05/14/2019 at 9:06 AM #98426Here is my code
Not sure what u mean by Instrument sorry
1 min time frame on the any market/chart i apply it too
hope that helps, if u need more please let me know
cheers
DJ
123456789101112131415161718192021222324252627// Definition of code parametersDEFPARAM CumulateOrders = False // Cumulating positions deactivated// Prevents the system from placing new orders on specified days of the weekdaysForbiddenEntry = OpenDayOfWeek = 0// Conditions to enter long positionsindicator1 = MACDline[12,26,9](close)indicator2 = ExponentialAverage[9](indicator1)c1 = (indicator1 < indicator2)IF c1 AND not daysForbiddenEntry THENBUY 1 CONTRACT AT MARKETENDIF// Conditions to enter short positionsindicator3 = MACDline[12,26,9](close)indicator4 = ExponentialAverage[9](indicator3)c2 = (indicator3 > indicator4)IF c2 AND not daysForbiddenEntry THENSELLSHORT 1 CONTRACT AT MARKETENDIF// Stops and targetsSET STOP pTRAILING 10SET TARGET pPROFIT 10005/14/2019 at 9:18 AM #98427macd trader123456789101112131415161718192021222324252627// Definition of code parametersDEFPARAM CumulateOrders = False // Cumulating positions deactivated// Prevents the system from placing new orders on specified days of the weekdaysForbiddenEntry = OpenDayOfWeek = 0// Conditions to enter long positionsindicator1 = MACDline[12,26,9](close)indicator2 = ExponentialAverage[9](indicator1)c1 = (indicator1 < indicator2)IF c1 AND not daysForbiddenEntry THENBUY 1 CONTRACT AT MARKETENDIF// Conditions to enter short positionsindicator3 = MACDline[12,26,9](close)indicator4 = ExponentialAverage[9](indicator3)c2 = (indicator3 > indicator4)IF c2 AND not daysForbiddenEntry THENSELLSHORT 1 CONTRACT AT MARKETENDIF// Stops and targetsSET STOP pTRAILING 10SET TARGET pPROFIT 10005/14/2019 at 9:28 AM #98431i cant work out why its buying and selling at the same time
Your code doesn’t do above on my platform … it does attached.
EDIT / PS
What do you have spread set at?
If you have it set at 10 then it will do what you are experiencing due to your TS of 10.
05/14/2019 at 9:28 AM #9843305/14/2019 at 9:30 AM #9843605/14/2019 at 9:44 AM #98439i asked in another thread what MAE and MFE stand for, so i best get these dumb questions out of the way as well Abs Perf? Relate Per%? what do they mean please?
Does nbr bars refer to the points/pips of trade?
Also, i have a trailing stop of 10 set why is it then on the losing trades that the nbr bars showing 10 + shouldnt this close the trade at 10 losing points instead of the 20, 23, 19 that it shows?
cheers
DJ
05/14/2019 at 9:45 AM #98441It’s because your trailing stop is hit, usually within the first bar, since it’s really tight.
As you can see from my Pic1 (the same as your, but abridged), the first two trades are tagged both as ENTRY first, then as TRAILING STOP on exit. While the third one hit your target profit.
You can easily spot them on pic2.
05/14/2019 at 9:47 AM #98444Mine is on DAX, 1h, that’s what I meant by “instrument“.
05/14/2019 at 11:46 AM #9845405/14/2019 at 11:50 AM #98455Its interesting to see the same strategy do completely different things , on the left is the asx200 index, which is after hours now, and then on the right the EUR/USD, being a FX trade im guessing the market doesnt shut down like each countries local Stockmarkets.
05/14/2019 at 11:53 AM #98457whats a more reasonable trailing stop, take profit margin to assist it?
Try using the Optimiser to determine above.
Have you watched Nicolas videos?
05/14/2019 at 11:55 AM #98458i cant work out why its buying and selling at the same time
Your code doesn’t do above on my platform … it does attached.
EDIT / PS
What do you have spread set at?
If you have it set at 10 then it will do what you are experiencing due to your TS of 10.
If i have what part set at 10? the TS or something else?
05/14/2019 at 12:36 PM #98466If i have what part set at 10? the TS or something else?
See red squiggly line on attached
-
AuthorPosts
Find exclusive trading pro-tools on