Exit on Close?
Exit on Close?
Im trying to backtest a system and I would like to have the position exit on the close of the day.....Is there a simple code for this? If Im long or short to exit on close.... Thankyou
Thankyou, but for some reason it dosent reconize the word 'setexitonclose' and Im not real familiar with EL, can you give me an exapmle how to use it at the end of this sample code:
Code: Select all
inputs: Price( Close ), FastLength( 9 ), SlowLength( 18 ) ;
variables: FastAvg( 0 ), SlowAvg( 0 ) ;
FastAvg = AverageFC( Price, FastLength ) ;
SlowAvg = AverageFC( Price, SlowLength ) ;
if CurrentBar > 1 and FastAvg crosses over SlowAvg then
Buy ( "MA2CrossLE" ) next bar at market ;
if CurrentBar > 1 and FastAvg crosses under SlowAvg then
Sell Short ( "MA2CrossSE" ) next bar at market ;
Is SetExitOnClose added to the list of supported keywords?
I thought SetExitOnClose is not currently supported yet.
Please confirm that which keywords and/or other things have been added to the list of currently supported list.
HR
Please confirm that which keywords and/or other things have been added to the list of currently supported list.
HR
Just try to add this word at the end of your code.Thankyou, but for some reason it dosent reconize the word 'setexitonclose' and Im not real familiar with EL, can you give me an exapmle how to use it at the end of this sample code:
Code: Select all
inputs: Price( Close ), FastLength( 9 ), SlowLength( 18 ) ;
variables: FastAvg( 0 ), SlowAvg( 0 ) ;
FastAvg = AverageFC( Price, FastLength ) ;
SlowAvg = AverageFC( Price, SlowLength ) ;
if CurrentBar > 1 and FastAvg crosses over SlowAvg then
Buy ( "MA2CrossLE" ) next bar at market ;
if CurrentBar > 1 and FastAvg crosses under SlowAvg then
Sell Short ( "MA2CrossSE" ) next bar at market ;