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 :
IF LongCondition AND Not OnMarket Then
Buy 1 Shares
ENDIF
with “Not OnMarket” I do not consider yesterday’s positions but only today’s ?
All positions… just not on market…
Today 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
Hoooo, 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?
Simply 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.
@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)
There you go:
DEFPARAM CumulateOrders = True
ONCE Flag = 1
IF IntraDayBarIndex = 0 THEN
Flag = 1
ENDIF
IF MyLongConditions AND (Not OnMarket OR (OnMarket AND Flag = 1)) THEN
BUY 1 Contract at Market
Flag = 0
ENDIF
you must allow accumulation of positions, of course.
tks 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