Thanks Eugene, really apreciate any help. I'm pretty new to this programing language, it's completely different from the fortran/basic language that I learned in school, a long, long time ago.
1) I took what you did and tryed to reverse the logic for short sells and came up with the code listed below. Which seems to work somewhat, but doesn't calculate the trailing stop correctly. I'm not sure if I'm applying the MAEAsOfBar script correctly.
2) Also what code would satisfy the criteria that today's open is <= previous day's close. Not sure what script from your example was used to establish that today's open is >= previous day's close. On line 38, the condBuy of your example, what does the "Date[bar].Date == Date[firstBar].Date" signify?
3) Also, on the last line of code (your above example) "if( condBuy )" then "BuyAtMarket(bar + 1);" was changed to "BuyAtMarket(bar);", which seems to buy as the price is exceeding the high of the 1st 5min bar, instead of waiting until that current bar closes. Will this cause any problems?
Again, thanks for the help.
CODE:
Please log in to see this code.