Hello all,
I hope a simple question:
On many of the pre built signals in Multicharts I see the code:
Condition 1 = firstbaronchart > 1
What is the purpose of having this in the code?
GuppyDRV
Firstbaronchart > 1
- Svetlana MultiCharts
- Posts: 645
- Joined: 19 Oct 2017
- Has thanked: 3 times
- Been thanked: 163 times
Re: Firstbaronchart > 1
GuppyDRV,
What is the name of the pre-built signal where you see this condition?
What is the name of the pre-built signal where you see this condition?
Re: Firstbaronchart > 1
Svetlana,
Thanks for the reply and sorry for my long delay in responding. I missed your post previously.
Referencing "RSI LE" for an example of what I'm talking about. The actual line of code is:
I mistakenly used the wrong wording "Firstbaronchart > 1" in my original post. I'm still not certain why we would need to check for ( condition1 = Currentbar > 1) with this Signal and not others?
Additionally, If I may add another question to this thread? Why in signals like Profit Target, Stop Loss etc... is
[IntrabarOrderGeneration = false]
Would we not need it set to true? Or will the reserve words such as SetProfitTarget automatically allow for IOG with regard to the target. If so why do we even bother setting the IOG=False in code?
With regard to PositionBasis within the same signals such as Profit Target etc.... Why is it set to False in the code. My understanding of PositionBasis is that it would differentiate the profit target for the entire position if true and individual contracts if false. The input setting is to false which implies this would work for individual contracts.
Code for Profit Target:
This line of code:
to me indicates that follow on script will only run if PositionBasis=True? If so how is it being set to true?
I know these are very basic questions but as hack coder it would be helpful to understand.
Thanks,
GuppyDRV
Thanks for the reply and sorry for my long delay in responding. I missed your post previously.
Referencing "RSI LE" for an example of what I'm talking about. The actual line of code is:
Code: Select all
condition1 = Currentbar > 1 and var0 crosses over OverSold ;
Additionally, If I may add another question to this thread? Why in signals like Profit Target, Stop Loss etc... is
[IntrabarOrderGeneration = false]
Would we not need it set to true? Or will the reserve words such as SetProfitTarget automatically allow for IOG with regard to the target. If so why do we even bother setting the IOG=False in code?
With regard to PositionBasis within the same signals such as Profit Target etc.... Why is it set to False in the code. My understanding of PositionBasis is that it would differentiate the profit target for the entire position if true and individual contracts if false. The input setting is to false which implies this would work for individual contracts.
Code for Profit Target:
Code: Select all
[IntrabarOrderGeneration = false]
inputs: PositionBasis( false ), Amount( 5 ) ;
if PositionBasis then
SetStopPosition
else
SetStopShare ;
SetProfitTarget( Amount ) ;
Code: Select all
if PositionBasis then
I know these are very basic questions but as hack coder it would be helpful to understand.
Thanks,
GuppyDRV
Re: Firstbaronchart > 1
So a self update! With some experimentation I've got the use of the PositionBasis reserve wording down using the following code.
It now executes on a per contract basis and the upside is that it functions a bit faster with optimization than applying both the built in signals ProfitTarget and StopLoss. I know some basic stuff!
Now for the more difficult question. I trade two different strategies applied to the same chart at the same time. Works great manually when I have two incidences of Multicharts open and am just watching the profit performance visually and hand submitting trade exits but I'm trying to automate this aspect so a whole new game for me.
Each strategy has different entry points and requires different ProfitTarget and Stoploss amounts. Now I'm going to embarrass myself publicly with my Multicharts knowledge. My belief is that they are OCO orders and will be submitted to the Broker (I use I.B.) after a trade conformation is received. If i only had one strategy running that would be all that were needed but with two my thoughts are that the differing targets would get in each others way with the lower target point always getting executed before the higher could be reached.
I tried creating a conditional check as follows.
My thoughts were that I could have a different one for each strategy! Well not so fast says Multicharts! This doesn't work as I'm sure placing the OCO logic inside the IF then statement is not allowed. Why? Is it related to the receipt of Broker confirmation and submission after this fact. As in strategy will not actually calculated again to hit the conditional check and send them?
If they are submitted after Broker conformation........am I thinking correctly that only those stops associated with the strategy that generated the entry order will be transmitted? Assuming the are not nested incorrectly in a conditional statement as I have shown. Could it be that simple? I haven't tried trading this on my I.B. paper trade account so I'm not sure of the answer.
Any help clarifying Multicharts system logic would be great.
Thanks in advance,
GuppyDRV
Code: Select all
setstopcontract ;
SetProfitTarget( Amount1PT ) ;
setstopcontract ;
SetStopLoss( Amount1SL ) ;
Now for the more difficult question. I trade two different strategies applied to the same chart at the same time. Works great manually when I have two incidences of Multicharts open and am just watching the profit performance visually and hand submitting trade exits but I'm trying to automate this aspect so a whole new game for me.
Each strategy has different entry points and requires different ProfitTarget and Stoploss amounts. Now I'm going to embarrass myself publicly with my Multicharts knowledge. My belief is that they are OCO orders and will be submitted to the Broker (I use I.B.) after a trade conformation is received. If i only had one strategy running that would be all that were needed but with two my thoughts are that the differing targets would get in each others way with the lower target point always getting executed before the higher could be reached.
I tried creating a conditional check as follows.
Code: Select all
ATMTrig1 (False),
If ATMTrig1 then begin
setstopcontract ;
SetProfitTarget( Amount1PT ) ;
setstopcontract ;
SetStopLoss( Amount1SL ) ;
end;
If marketposition = 0 then ATMTrig1 = False;
If they are submitted after Broker conformation........am I thinking correctly that only those stops associated with the strategy that generated the entry order will be transmitted? Assuming the are not nested incorrectly in a conditional statement as I have shown. Could it be that simple? I haven't tried trading this on my I.B. paper trade account so I'm not sure of the answer.
Any help clarifying Multicharts system logic would be great.
Thanks in advance,
GuppyDRV