A script that won't work

sopelote

Junior member
Messages
14
Likes
0
Hi, I am new at this and I have been given a strategy to try and the buy signals don't plot on my charts..The sell signals do but the buys don't. Would someone please look at this buy signal and tell me if there is an obvious flaw in it? Or advise me for the next troubleshooting step? manythanks

here is the script for the 'buy' long signal that dosen't work;


ValueHighBand = T3average(Price_ValueH,Period_High) of data2;
ValueLowBand = T3average(Price_ValueL,Period_Low) of data2;

If (Average(close, SMALength) of data2 > Average(close, SMALength)[1])of data2 then
Buy("Buy T2") (ValueLowBand + 1) point Limit;

If MarketPosition = 1 Then
Begin exitlong currentcontracts Contracts ValueHighBand Limit;
end;
 
Last edited:
Perhaps, it would help to compare the script above of a buy long that did not work (signal)
and here is it's opposite an enter short sell that does work and prints the signal, fine..'


ValueHighBand = T3average(Price_ValueH,Period_High) of data2;
ValueLowBand = T3average(Price_ValueL,Period_Low) of data2;

If (Average(close, SMALength) of data2 < Average(close, SMALength)[1])of data2 then
Sell("Sell T2") (ValueHighBand - 1 point) Limit;

If MarketPosition = -1 Then
Begin exitshort currentcontracts Contracts ValueLowBand Limit;
end;
 
Last edited:
Try changing the line that says:

If (Average(close, SMALength) of data2 > Average(close, SMALength)[1])of data2 then
Buy("Buy T2") (ValueLowBand + 1) point Limit;

to the following:

If (Average(close, SMALength) of data2 > Average(close, SMALength)[1])of data2 then
Buy("Buy T2") (ValueLowBand + 1 point) Limit;

You appear to have got the bracket () in the wrong position on the last line where I have highlighted it in red


Paul
 
thanks Paul...fortunately, I solved the problem with luck by clicking on an error that the ES editor was showing...it said that some inputs had possibly been renamed..so I clicked on it and it gave me a choice to 'add' the new ones..I did and eureeka ..it works..many thanks for your input too..
oops...i guess it didnt work after all.... im back where i started..Paul that error that you pointed out, I had just added myself to the code..I better stop doing that ..not messing with it until i know what im doing so I changed it back to what you noted, that's the way it was before I messed with it..
anyway, I wonder what that error #284 was...its not there now but it indicates to me that my problem is in the renaming of an input.. cause i had 'fixed' it temporarily..im sorry if this is all so confusing and frustrating to whoever reads this...I am just beginning with this and its tough.. :eek:
 
Last edited:
Top