Buy if Not OnMarket, Reset every day
Forums › ProRealTime English forum › ProOrder support › Buy if Not OnMarket, Reset every day
- This topic has 7 replies, 3 voices, and was last updated 1 year ago by ZeroCafeine.
-
-
04/24/2023 at 12:48 PM #213674
Hi
I want to buy if I am not in the market today, But I do not take into consideration positions from the day before :
123IF LongCondition AND Not OnMarket ThenBuy 1 SharesENDIFwith “Not OnMarket” I do not consider yesterday’s positions but only today’s ?
04/24/2023 at 1:12 PM #21367504/24/2023 at 1:22 PM #213676Today I can buy if I’m not on market today, but I don’t considering the position of yesterday
Day 1 : buy one share if I’m not on market
Day : even I I’m in position from yesterday, I not considering this, I can buy today but I can’t cumulate order today
04/24/2023 at 1:40 PM #213678Hoooo, now because of trying to make a good question I think I found the solution, maybe I just have to count the share of last day, and considering this number like zero for today, I will try to program this after, if you have other solution?
04/24/2023 at 4:07 PM #213687Simply check, when IntradayBarIndex = 0 (i.e. a new day just started), if you are onmarket. If you are then set a FLAG to 1, and use that FLAG as an additional condition to open a new position (to accumulate if it’s the same direction, or Stop & Reverse if it’s not). If you enter a new position clear FLAG, i.e. set it to zero.
1 user thanked author for this post.
04/25/2023 at 12:43 PM #213715@robertogozzi tks for the Flag tips,
Do you have a link from the forum with a very complex flag method, it will perhaps allow me to appropriate the method
Do you use a specific software for the analysis ?
I realize now that my programming problem with ProRealTime is due to the analysis of what I want to do, I am very good in analysis, but how to put an analysis on paper, I had learned the method of patatoide I think long time ago (potatoide, I don’t know how to say it in english)
04/25/2023 at 3:25 PM #213729There you go:
123456789DEFPARAM CumulateOrders = TrueONCE Flag = 1IF IntraDayBarIndex = 0 THENFlag = 1ENDIFIF MyLongConditions AND (Not OnMarket OR (OnMarket AND Flag = 1)) THENBUY 1 Contract at MarketFlag = 0ENDIFyou must allow accumulation of positions, of course.
1 user thanked author for this post.
04/25/2023 at 10:47 PM #213755tks you for the solution, I found a solution just before your answer, and I thank you very much for the effort you make to formulate such precise answers,
for quality answers, you are very strong or I am very weak, in any case you are stronger,
I tested your solution, it makes me buy 2 times in A and 2 times in B, my solution suits me and makes me buy once in C and D, I wil try to understand and use also your solution
-
AuthorPosts
Find exclusive trading pro-tools on