I am trying to create the script in Tradestation for trading the 1200 noon bar, so if the price exceeds the high by .01 points or low .01 points a trade is triggered.
I have tried many scripts which reference a time but they are not using the high and low of the 1200 bar unless the trigger time is 1230. If the time is 1330 and there is a breakout it references the 1300 bar not the 1200 bar. What I am trying to do is use the 1200 bar as a static bar so if there is a breakout at 3:30 it must use the high +.01 or the low-.01 of the 1200 bar to trigger the signal.
I have tried for days to accomplish this and looked at examples in this forum which I adjusted, but it is still incorrect.
Thankyou to everyone who reads this.
Can you help answer these questions from other members on futures io?
Here is a line of code for an EasyLanguage entry at noon for the prior high +.01.
It assumes you are using 60 minute bars. Easy language will only trade on the "next bar". So this code activates on the 11:00 bar, but doesn't enter the trade until noon.
If time=1100 Then buy ("Noon_Breakout") 1 contracts next bar at high+.01 limit;
Please ask more questions if this type of code is not what you are looking for.
Good luck with your code.
The following user says Thank You to SidewalkAerobics for this post:
depending on the time frame you can store the high and low of a specific bar inside variables and then use these variables later. If you have two variables called vHigh and vLow you could for example store values at 1200 like this (under the condition that you have bars with this timestamp):
Regards,
ABCTG
The following user says Thank You to ABCTG for this post:
Thankyou for your reply and your time. Close but still off a bit. It will only buy at 1300 and nothing after. If it is 1500 it will not enter the trade.
vars: high_at_noon(0), low_at_noon(0);
if time = 1200 then begin
high_at_noon = High;
low_at_noon = Low;
end;
if time > 1200 then begin
buy next bar at high_at_noon + 0.01 stop;
sellshort next bar at low_at_noon - 0.01 stop;
end;
I just figured it out. Thankyou very much for your time !
A good way to pay back your thanks is to post your final code, so that others who are struggling (in the future) with a similar problem may know the final solution.
The following 2 users say Thank You to GoldenRatio for this post: