One trade and no Exit
Author: LoneTreeTrading
Creation Date: 1/4/2009 4:08 PM
profile picture

LoneTreeTrading

#1
I am learning to write programs and started with a simple one to buy when a key reversal occurs. I have only been able to get the program to make a single entry and no exit, even a very simple one. Could someone point out when I'm missing the proper code for the exit?

CODE:
Please log in to see this code.
profile picture

Eugene

#2
QUOTE:
I have only been able to get the program to make a single entry and no exit, even a very simple one. Could someone point out when I'm missing the proper code for the exit?

Your placement of variables before the trading loop, along with the usage of Bars.Count, makes them fixed over the course of the Strategy's execution.
CODE:
Please log in to see this code.