NewYork, NY
Posts: 7 since May 2016
Thanks Given: 1
Thanks Received: 2
|
Hi experts,
I'm very new to EZL, so sorry for the stupid question.
I created an indicator that signal buy/sell and plot. The signal is working fine. But, when i get the signal I want to place an order from the indicator itself.
I first tried the function Buy/Sell, EZL tells me that's not allowed in indicator. I tried the macro .PlaceOrder, EZL didn't like it when verified.
Now I used the command LimitOrder, but it returns me as invalid order. Thisi is my code. After much reading and research on the net, i'm still a bit confused as to which command/function can be used in indicator.
Any help is much appreciated.
price_trigger = (High + Low) /2 ;
Plot2 (buy_signal, "Buy");
Plot3 (Price_Trigger, "Price_Entry");
PositionQty = Getnumpositions ("SIM8625555M");
OrderQty = UserQty - PositionQty;
//.PlaceOrder "Action='Buy', OrderType = 'Limit', Quantity = OrderQty, QuantityType = 'Shares', Route = 'Intelligent', Symbol = EquitySymbol, SymbolCategory = 'Equity'"; // TRIED THIS, DIDN'T WORK
OrderValid = LimitOrder ("OncePerBar", "SIM8625555M", "Buy", "Equity", EquitySymbol, OrderQty, "1min", "", Price_trigger);
PauseSellTime = Currenttime + 1.5;
PauseBuyTime = Currenttime + 1.5;
//Playsound ("c:\AirHorn.wav");
If OrderValid = 0 then PauseBuyTime = 1;
|