Cumulative orders based on prev order and ATR?
Forums › ProRealTime English forum › ProOrder support › Cumulative orders based on prev order and ATR?
- This topic has 7 replies, 3 voices, and was last updated 7 years ago by
Despair.
-
-
09/16/2017 at 9:43 AM #46336
Hi,
I’m stuck and could use a little help.
I would like to add orders based on price of last order + ATR, I think I got that right. But I would also like the Stop Loss to follow along, that’s to big challange for me. Anyone want to help?
Example.
Price 100
ATR 10
Order 1: 1 contract @ 100, stop @ 90
Order 2: 1 contract @ 110. stop @ 100 and stop for order 1 should also move to 100
Order 3: 1 contract @ 120, Stop @ 110 and stop for both order 1 and 2 should move to 110
Order 4: 1 contract @ 130, stop @ 120 and stop for order 1-3 should move to 120.
Maximum orders at any give time is 4 and the last stop should not move from 120. Exit is @ Low [n] not a stop loss.
If let’s say price move to 115 and down to 75, order 1-2 should execute and then stop out @ 100 with 10 loss.
Let’s say price move to 200 and then down to 110, and Exit (Low [10]) is 180, all the orders should exit @ 180 with entry @ 100-110-120-130 and profit 260.
It’s alot like the moneymanagementsystem as turtle traders used back in the day….at least according to one of the books.
09/16/2017 at 9:49 AM #4633709/16/2017 at 10:06 AM #4634009/16/2017 at 10:51 AM #46344Thanks, here’s the code so far:
I’m looking for a modified version of turtle trading strategy, most for fun and see if it works nowadays. Read the book couple of weeks ago, great story by the way. 🙂
Adding 1/4 ATR to each position and move the stop accordingly, the first example was for ilustration only.
For backtesting1234567891011121314151617181920212223242526DEFPARAM CUMULATEORDERS = truea = highest[55](high)b = lowest[20](low)c = Average[50](close)d = Average[200](close)Avg = 0.25*AverageTrueRange[14](close)// Long EntryLong = HIGH>a[1] AND c > d// Long ExitLongExit = LOW<b[1]if countofposition<=4 thenIF NOT LongOnMarket AND Long THENBUY 1 CONTRACTS AT MARKETENDIFIF High>TradePrice(1)+avg THENBUY 1 CONTRACTS AT MARKETENDIFENDIFSET STOP LOSS 2*AverageTrueRange[14](close)If LongOnMarket AND Longexit THENSELL AT MARKETENDIF09/16/2017 at 11:14 AM #4634709/16/2017 at 11:40 AM #4634909/16/2017 at 12:00 PM #4635009/16/2017 at 12:34 PM #46351 -
AuthorPosts
Find exclusive trading pro-tools on