is it possible to sell at todays bar close? since backtesting can be made in tick mode?
If so, could someone help me with this code:
price must be above close 30 days ago
close must be lower than close 9 days ago
buy and next bar open and sell on bar close..
It is not possible to sell at the close of any bar as all orders go to market at the open of the bar after the decision bar. The closest you could get is to use MTF on a 1 second timeframe and sell at open of the final second of a day. MTF is not currently possible in real live trading. Also using 1 second charts seriously limits amount of back test data available for testing. It is also not possible to live trade algos on tick charts – backtesting is possible but not real live trading.
It is not possible to sell at the close of any bar as all orders go to market at the open of the bar after the decision bar. The closest you could get is to use MTF on a 1 second timeframe and sell at open of the final second of a day. MTF is not currently possible in real live trading. Also using 1 second charts seriously limits amount of back test data available for testing. It is also not possible to live trade algos on tick charts – backtesting is possible but not real live trading.
okay, thanks for answering. I would be fine buying 9.00 and selling 17,25 on 5min chart.
Would you be able to help me with the code?
Mean reverting strategy?
Here is the code built with MTF capability (you’ll not able to use it until the public release of it)
defparam cumulateorders=false
TIMEFRAME (daily,updateonclose)
close30=close[30]
close9=close[9]
TIMEFRAME (5 minute,updateonclose)
condition = close>close30 and close<close9 and time=090000
if not onmarket and condition then
buy at market
endif
if longonmarket and time=172500 then
sell at market
endif
graph close30
graph close9 coloured(200,0,0)
graph close
//graph condition
Mean reverting strategy?
Here is the code built with MTF capability (you’ll not able to use it until the public release of it)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
|
defparam cumulateorders=false
TIMEFRAME (daily,updateonclose)
close30=close[30]
close9=close[9]
TIMEFRAME (5 minute,updateonclose)
condition = close>close30 and close<close9 and time=090000
if not onmarket and condition then
buy at market
endif
if longonmarket and time=172500 then
sell at market
endif
graph close30
graph close9 coloured(200,0,0)
graph close
//graph condition
|
thank you very much nicolas 🙂
So that means we can not us coding to Buy or Sell on Automatic trading only backtesting
So that means we can not us coding to Buy or Sell on Automatic trading only backtesting
You can use code via ProOrder to Buy and Sell using automatic trading.
Multi Time Frame (MTF) trading was introduced a long time ago now and there were some teething problems at the beginning and for a while it was only available by request. The posts in this topic are from a year ago.