Click here to Login

                                                   Active position


Amritendu Maji
2017-07-24 09:51:38

How can I figure out if I have an active position using?

I want to determine the highest high since last entry and lowest low since last long position.

How do I do that?

Amritendu Maji
2017-07-24 11:31:36


Also, does the "buy" or "sell" rules return a value of 1 when successful?

For example,
buy = Close > Open;

a = if(buy == 1, 1000, -1000);

Is this possible?

Thank you,

Amritendu Maji
2017-07-25 00:29:07


Another question...

BarSinceSell = Barssince(Sell);
LowestClose = LLvLB(close,Barssince(BarSinceSell));

Why is it not working?

Thank you,

2017-07-25 12:14:19


1/ does the "buy" or "sell" rules return a value of 1 when successful?
Yes. You can just plot any variable on a chart to see what it returns.
Print function will display the data in "View -> Output"

2/ In the second line you are calculating "Barssince(BarSinceSell)". I am not sure why you are doing this. Please check the variable on a chart to understand and debug your formula.

Also, note that QS formula is run to get signals only and at that time the backtester does not know yet which stocks will be bought/sold. It order to use the entry price and stuff like that you need to use the money management tool.

Amritendu Maji
2017-07-25 12:45:06


for No. 2, I tried

LowestClose = LLvLB(close,Barssince(Sell));

It had a line drawn under "Sell". What is wrong with this syntax?

I think I need some guidance to show me:
1. How to check variables on a chart.
2. An example on how to use the basic QS based trading system and the MM tool together for a system.

Thank you.

Amritendu Maji
2017-07-25 18:47:57


Got my answer to how to check variables on a chart from here -

Need the other answers.

Thank you.

2017-07-26 10:56:54


Best Answer
"llvlb" returns the number of bars since the array reached its lowest value.
If you want to get the lowest close price then use:
a = LLvLB(close,Barssince(Sell));
LowestClose = ref(close, a);

Regarding MM scripts, you can find many blog posts about that.

No more messages


No html code. URLs turn into links automatically.

Type in the trading objects you want to include: - Add Objects
To add a trading object in your message, type in the object name, select it and then click on "Add Objects"


Trading Items
Stock Industry Position
NSE - Security-wise Delivery Position
Trading based on Boillinger Lower Band position on defined Market
Volatility-based Position Sizing Method with Adjustable Parameter...
Trading System Template: Position Sizing Techniques

How-to Lessons
How to download EOD quotes for active and valid stocks only
How to create a trading system
How to display notes/commentaries on a chart
How to use a custom drawing tool
How to quickly add several positions to your portfolio

Related Forum Threads
Dynamic Position
Dynamic Position Sizing
Simulation/Back testing - Default position sizing method
Set Position Size by Ticker Within Main Strategy
How do I reduce a position size from within the Money Management

Blog Posts
Dynamic Position Sizing in your Trading System
Update Chart Layout based on Active Time Frame
Update Chart Layout based on Active Ticker Symbol - Part 2
5 position sizing techniques you can use in your trading system
Update Chart Layout based on Active Ticker Symbol

Create an account
Affiliate Program
Contact Us
Trading Forum
How-to Lessons
About Us
Terms of Use

Copyright 2021
Social Media
Follow us on Facebook
Twitter Follow us on Twitter
Follow us on Google+
RSS Trading Items

Trading financial instruments, including foreign exchange on margin, carries a high level of risk and is not suitable for all investors. The high degree of leverage can work against you as well as for you. Before deciding to invest in financial instruments or foreign exchange you should carefully consider your investment objectives, level of experience, and risk appetite. The possibility exists that you could sustain a loss of some or all of your initial investment and therefore you should not invest money that you cannot afford to lose. You should be aware of all the risks associated with trading and seek advice from an independent financial advisor if you have any doubts.