|
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
0
|
|
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);
print(a);
Is this possible?
Thank you,
Maji
|
|
|
|
Amritendu Maji
2017-07-25 00:29:07
0
|
|
Another question...
BarSinceSell = Barssince(Sell);
LowestClose = LLvLB(close,Barssince(BarSinceSell));
Why is it not working?
Thank you,
Maji
|
|
|
|
QuantShare
2017-07-25 12:14:19
0
|
|
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
0
|
|
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
0
|
|
Got my answer to how to check variables on a chart from here -
https://www.quantshare.com/sa-582-the-ultimate-guide-to-create-trading-systems-in-quantshare
Need the other answers.
Thank you.
|
|
|
|
QuantShare
2017-07-26 10:56:54
0
|
|
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.
Example:
https://www.quantshare.com/sa-339-basic-trading-system-implemented-using-the-money-management-tool
|
|
|
|