only one trade per day on 3 strategies
Forums › ProRealTime English forum › ProRealTime platform support › only one trade per day on 3 strategies
- This topic has 59 replies, 6 voices, and was last updated 7 years ago by Andy11.
-
-
11/09/2016 at 1:35 PM #1623111/30/2016 at 11:44 AM #17542
hi,
still interest in help for my different daily strategies, on the code below I only like to have one execution the day ,
this is one strategie on a couple of , so the question is , what do I have to put in for only ONE execution the day …on DAX mini , 1min chart
Defparam cumulateoders=false//
defparam flatbefore=080000
defparam flatafter=173000
indicator1=close
indicator2=Bollingerdown[20](close)
c1=(indicator1<indicator2)
if c1 then
buy 20 contract at market
endif
set stop ploss0
set target pprofit 1
11/30/2016 at 1:10 PM #17546This should do (try and let me know):
12345678910111213141516171819// onlu ONE trade per Day//Defparam cumulateorders = falsedefparam flatbefore = 080000defparam flatafter = 173000ONCE OneTrade = 0IF time = 000000 THENOneTrade = 0ENDIFindicator1 = closeindicator2 = Bollingerdown[20](close)c1 = (indicator1 < indicator2)c2 = (OneTrade = 0)if c1 AND c2 thenbuy 20 contract at marketOneTrade = 1endifset stop ploss 0set target pprofit 111/30/2016 at 1:23 PM #1754911/30/2016 at 1:59 PM #17551Just as is, no quotres, no carets, apostrophes or whatever, only 000000 (hhmmss).
I’m pasting a more readable code:
12345678910111213141516171819// only ONE trade per Day//defparam cumulateorders = falsedefparam flatbefore = 080000defparam flatafter = 173000ONCE OneTrade = 0IF time = 000000 THENOneTrade = 0ENDIFindicator1 = closeindicator2 = Bollingerdown[20](close)c1 = (indicator1 < indicator2)c2 = (OneTrade = 0)if c1 AND c2 thenbuy 20 contract at marketOneTrade = 1endifset stop ploss 0set target pprofit 111/30/2016 at 2:06 PM #1755511/30/2016 at 2:12 PM #17557I used on a 1 minute chart and it worked, just one trade per day.
Of course I commented out all conditions and unused variables.
Try again.
11/30/2016 at 2:29 PM #1755811/30/2016 at 3:00 PM #17562It works on timeframes < 1 day (I used 1 minute charts, not daily) because of WHEN a strategy is processed by ProOrder.
Each strategy is processed at the closure of the candle of the timeframe you want to deal with. In this case it is D1 (daily), so it is run when the daily candle closes. Then again after 24 hours!
You may want to use the above code on a smaller TF trying to adjust conditions and variables so they suit a daily strategy, if possible…. otherwise drop that strategy!
I don’t know if there is any system that can afford to scan and run ALL strategies, say every second or minute, to monitor conditions. The time required would be much greater than a second and even a minute!!!
11/30/2016 at 3:08 PM #1757111/30/2016 at 3:19 PM #17573It works on Aud/Cad, 1 minute, with conditions and unused variables commented out.
See the outcome attached.
1 user thanked author for this post.
11/30/2016 at 3:22 PM #1757711/30/2016 at 3:57 PM #17582You’d switch to Aud/Cad, it looks more profitable!
11/30/2016 at 3:59 PM #1758311/30/2016 at 5:51 PM #17594Dreif, I think you will find that my original suggestion works just fine as it did with the original I edited for you. The logic is simple to copy to your other code. Did you try this yet as suggested? If coding is for you, it will make you better in the long run. Everyone here does not mind helping but you have to try for yourself too. 🙂
Roberto has kindly given his time. Comments like that are not helpful to this friendly community. If you feel something is not working, post code and pics to help explain as Roberto has done for you.
-
AuthorPosts
Find exclusive trading pro-tools on