dear all,
I'm achieving weird results assegning Sellprice by IIF function:
I want to sell at the close of the day before and the following script work very well:
SetTradeDelays (0,1,1,1);
SellPrice=Ref(C,-1);
But if there is a gap, and next day open is below the before day close, I want to sell at next day open. The following script works very well
SetTradeDelays (0,1,1,1);
SellPrice=O;
But putting together the 2 above scripts for Sellprice in a IIF instruction:
SellPrice= IIf ( Ref(O, 1) < C, O, Ref(C,-1));
I achieve weird results, selling, now and then, at Open also when next day open is higher than before day close.
please test the IIF string with your data and let me know.
thank you
cippo
I'm achieving weird results assegning Sellprice by IIF function:
I want to sell at the close of the day before and the following script work very well:
SetTradeDelays (0,1,1,1);
SellPrice=Ref(C,-1);
But if there is a gap, and next day open is below the before day close, I want to sell at next day open. The following script works very well
SetTradeDelays (0,1,1,1);
SellPrice=O;
But putting together the 2 above scripts for Sellprice in a IIF instruction:
SellPrice= IIf ( Ref(O, 1) < C, O, Ref(C,-1));
I achieve weird results, selling, now and then, at Open also when next day open is higher than before day close.
please test the IIF string with your data and let me know.
thank you
cippo