hello pro’s!
if i have a long or short position i want to code:
if longonmarket then
“the last brick has to be greater then the last brick before” and
“the next brick hast to be greater then the last 2 bricks before”
“… 3 bricks before”
and so on….
is there any option to do that?
thx guys!
Are you talking about “renko brick”? or ordinary candlesticks?
sorry i mean just normal candlesticks… brick = candle
sorry
ok, so in this case, “greater” in your own words, means ‘higher price’ or ‘larger candlestick range’?
sorry for my bad explanation…
it means “higher price” – this is what I want to do:
- if longonmarket the next candle must be higher (in price) than the “open order” AND
the next candle must be higher (in price) than the last candle AND
the next candle must be higher (in price) than the last 2 candles (always take the last candles (1+1+1+1+…) since the open order)
- the last (f.e. 10 candles) must be 1/4 higher (in price: open order + 1/4) than the last candles since open order – otherwise sell at market
hope u can understand my thoughts now.
thx nicolas for helping me!
Sorry, still don’t understand what you mean.
1/ So each time a new candlestick close we must ensure that its price is higher than the last X candles Close since the open of the order (and X is incrementing continuously)?
2/ What “open order + 1/4” state for?
Do these 2 points must be tested at the same time to sell the buy order?
ad 1) exactly!
ad 2) thats just a part of future – not as important as step 1! i would be greatful if u could help with step 1!
thank you so much nicolas for helping me here!
could this be done anyhow?
i am thinking about something like
if longonmarket and data < tradeprice(tradeprice+1) then
sell at market
endif
Sorry for not answering since my last post..please remind me to have a look to your question next week.
Could you test this snippet about your first query?
// each time a new candlestick close we must ensure that
// its price is higher than the last X candles Close
// since the open of the order (and X is incrementing continuously)
if longonmarket then
period = max(1,barindex-tradeindex)
if summation[period](close>close[1])<>period then
sell at market
endif
endif
thats exactly what i was looking for! that’s my basic for some codes now! Thank you so much for your help and ur help for everyone here!