eur/usd 2m MA Candle strategi
Forums › ProRealTime English forum › ProOrder support › eur/usd 2m MA Candle strategi
- This topic has 5 replies, 4 voices, and was last updated 7 years ago by Magnusal.
-
-
04/26/2017 at 8:19 PM #33574
Im new to Pro Real Code so im asking if anyone can help me build a simple strategi (i think its simple:-)
Long position when a candle open above ma in 2min EUR/USD and sell when a candle crosses MA with X margin and the other way around for shorts.
Maybe its wise to separate this 2 strategis so you can use only one when it is a strong trend.
Great if anyone can put me in the right direction building this strategi
Magnus
04/26/2017 at 8:35 PM #3357904/26/2017 at 11:24 PM #33613Here you go buddy
12345678910111213141516171819202122232425262728// px-dx-test// --------------// -- System parameters --DEFPARAM preLoadBars = 1000// -- Variables --once positionSize = 1// maType = 0// maPeriod = 20// deathCrossMargin = 20// price = close // could be high | low | typicalprice etc etc// -- Indicators -----MA = average[maPeriod, maType](price)// -- long entry conditions -----bc1 = not longOnMarket and close crosses over MA// -- long exit conditions -----le1 = longOnMarket and price <= (MA - deathCrossMargin)// -- execution -----if bc1 thenbuy positionSize shares at marketelsif le1 thensell at marketendifHave fun with the variable optimizer and different instruments.
04/27/2017 at 8:01 AM #33623Small Change
You have to multiply Margin bu pipsize else its subtracting margin which is 20 from MA value.
12345678910111213141516171819202122232425262728// px-dx-test// --------------// -- System parameters --DEFPARAM preLoadBars = 1000// -- Variables --once positionSize = 1// maType = 0// maPeriod = 20// deathCrossMargin = 20// price = close // could be high | low | typicalprice etc etc// -- Indicators -----MA = average[maPeriod, maType](price)// -- long entry conditions -----bc1 = not longOnMarket and close crosses over MA// -- long exit conditions -----le1 = longOnMarket and price <= (MA - deathCrossMargin*pipsize)// -- execution -----if bc1 thenbuy positionSize shares at marketelsif le1 thensell at marketendif04/27/2017 at 8:46 AM #33628Hi Magnus welcome to the site,
>> Could you please update your country flag in your profile? Thank you 🙂 <<
(go to top right corner on your profile picture, a menu appears, click on “settings”, and in your profile select “location” and update your contry, thanks)
04/28/2017 at 11:08 AM #33833 -
AuthorPosts
Find exclusive trading pro-tools on