hi
Is it possible to use an output condition without using if then?
(in c# it's : If not(X) then return )
If not(X) then return;
- TJ
- Posts: 7746
- Joined: 29 Aug 2006
- Location: Global Citizen
- Has thanked: 1033 times
- Been thanked: 2225 times
Re: If not(X) then return;
hi
Is it possible to use an output condition without using if then?
(in c# it's : If not(X) then return )
Please explain with an example.
- JoshM
- Posts: 2195
- Joined: 20 May 2011
- Location: The Netherlands
- Has thanked: 1544 times
- Been thanked: 1565 times
- Contact:
Re: If not(X) then return;
It's not possible as far as I know to prematurely terminate the script calculation for a particular price update. (It would be helpful if we could, so I hope I'm mistaken here. )Is it possible to use an output condition without using if then?
(in c# it's : If not(X) then return )
You can of course put it in a big if statement (if X then ...). Placing your code in a function is another option, because functions can exit earlier with the `return` keyword.
- ABC
- Posts: 723
- Joined: 16 Dec 2006
- Location: www.abctradinggroup.com
- Has thanked: 125 times
- Been thanked: 410 times
- Contact:
Re: If not(X) then return;
JoshM,
you can use the #return statement to accomplish that.
The print starting with B will only start to appear with bar 100 in the output.
Regards,
ABC
you can use the #return statement to accomplish that.
Code: Select all
Print( "A CurrentBar = ", CurrentBar ) ;
if CurrentBar < 100 then
#return ;
Print( "B CurrentBar = ", CurrentBar ) ;
Regards,
ABC
It's not possible as far as I know to prematurely terminate the script calculation for a particular price update. (It would be helpful if we could, so I hope I'm mistaken here. )Is it possible to use an output condition without using if then?
(in c# it's : If not(X) then return )
You can of course put it in a big if statement (if X then ...). Placing your code in a function is another option, because functions can exit earlier with the `return` keyword.
- ABC
- Posts: 723
- Joined: 16 Dec 2006
- Location: www.abctradinggroup.com
- Has thanked: 125 times
- Been thanked: 410 times
- Contact:
Re: If not(X) then return;
turbofib,
take a look at the build in --- Market Depth on Chart --- indicator as it demonstrates different ways of flow control within an indicator.
Regards,
ABC
take a look at the build in --- Market Depth on Chart --- indicator as it demonstrates different ways of flow control within an indicator.
Regards,
ABC
hi
Is it possible to use an output condition without using if then?
(in c# it's : If not(X) then return )