The following thinkScript is executing at the "bid" price for the stock. Is there a way to change this so that the order sells based on the "ask," or is it possible to have the order trigger at the actual price of the stock? I included this script as a part of a conditional order. @halcyonguy was very helpful in helping create this thinkScript. Thank you very much for your time and your help.
Code:
input sell_percent_gain = -20.0;
input price1 = close;
input start = 0930;
def daystart = secondstillTime(start) == 0;
def dayopen = if daystart then open else dayopen[1];
def daydiff = round(price1 - dayopen,2);
def pergain = round(100*daydiff/dayopen,1);
input trigger_on_all_prices_below_stop = yes;
def sell1 = if (daystart or trigger_on_all_prices_below_stop) and pergain <= sell_percent_gain then 1 else
if pergain crosses below sell_percent_gain then 1 else 0;
plot z1 = sell1;
Last edited: