logo
Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Options
Go to last post Go to first unread
TomHam  
#1 Posted : Saturday, June 18, 2022 11:26:43 PM(UTC)
TomHam

Rank: Advanced Member

Groups: Registered, Registered Users, Subscribers
Joined: 10/23/2005(UTC)
Posts: 45
Location: Savannah

Was thanked: 6 time(s) in 4 post(s)

I'm trying write a formula so when a "set bar" occurs, the position is taken at the High (or Low) of the set up bar High / Low.

I've tried:

H > ValueWhen(1, Ref("setup is true",-1),H)   {then enter Long}

But that's not working.  Any suggestions?  Thanks.         .......  Tom  ........

MS Support  
#2 Posted : Monday, June 20, 2022 2:30:23 PM(UTC)
MS Support

Rank: Advanced Member

Groups: Moderators, Registered, Registered Users, Subscribers
Joined: 10/8/2010(UTC)
Posts: 1,960

Thanks: 92 times
Was thanked: 155 time(s) in 150 post(s)
Originally Posted by: TomHam Go to Quoted Post

I'm trying write a formula so when a "set bar" occurs, the position is taken at the High (or Low) of the set up bar High / Low.

I've tried:

H > ValueWhen(1, Ref("setup is true",-1),H)   {then enter Long}

But that's not working.  Any suggestions?  Thanks.         .......  Tom  ........

Hello,

Are you writing this formula for the System Tester? If so, one thing to keep in mind is that the default trade execution in the System Tester is to enter a trade at the Open of the bar after your condition occurs.

If you go to the System Tester and click the "Trade Options" button and then click the "Trade Execution" tab, you can uncheck "Realistic Market Prices", then adjust the Buy/Sell/Sell Short/Buy to Cover fields accordingly (i.e. set the Buy Price to High, Sell Price to Low, etc). You would also want to change the "Delay order opening" field to 0.

In this case you would simply need your basic formula condition combined with the above settings to get in at the High/Low of the signal bar.

TomHam  
#3 Posted : Thursday, June 23, 2022 3:54:43 PM(UTC)
TomHam

Rank: Advanced Member

Groups: Registered, Registered Users, Subscribers
Joined: 10/23/2005(UTC)
Posts: 45
Location: Savannah

Was thanked: 6 time(s) in 4 post(s)
Thanks for the reply. I will eventually write it in the "true statement" format that System tester requires but I like to debug and see it on a chart first. I used a work around using multiple lines of "If Then Else" logic to get it to work OK. Not elegant, but functional. Thanks again.
thanks 1 user thanked TomHam for this useful post.
MS Support on 6/24/2022(UTC)
Users browsing this topic
Guest (Hidden)
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.